MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / write_map_header

Function write_map_header

nodedb/src/data/executor/handlers/join/mod.rs:54–64  ·  view source on GitHub ↗

Write a msgpack map header.

(buf: &mut Vec<u8>, len: usize)

Source from the content-addressed store, hash-verified

52
53/// Write a msgpack map header.
54pub fn write_map_header(buf: &mut Vec<u8>, len: usize) {
55 if len < 16 {
56 buf.push(0x80 | len as u8);
57 } else if len <= u16::MAX as usize {
58 buf.push(0xDE);
59 buf.extend_from_slice(&(len as u16).to_be_bytes());
60 } else {
61 buf.push(0xDF);
62 buf.extend_from_slice(&(len as u32).to_be_bytes());
63 }
64}
65
66/// Iterate msgpack map entries and write each key prefixed with `prefix.`
67/// and its value bytes verbatim.

Callers 13

merge_join_docs_binaryFunction · 0.70
binary_row_projectFunction · 0.70
apply_post_aggregationFunction · 0.50
maybe_wrap_kv_point_getFunction · 0.50
scan_columnarMethod · 0.50
execute_aggregateMethod · 0.50
execute_kv_scanMethod · 0.50
apply_projection_msgpackFunction · 0.50
execute_point_updateMethod · 0.50
emit_memtable_rowFunction · 0.50
batches_to_document_rowsFunction · 0.50

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected