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

Function build_str_map

nodedb-query/src/msgpack_scan/writer.rs:279–286  ·  view source on GitHub ↗

Build a simple msgpack map from string key-value pairs.

(pairs: &[(&str, &str)])

Source from the content-addressed store, hash-verified

277
278/// Build a simple msgpack map from string key-value pairs.
279pub fn build_str_map(pairs: &[(&str, &str)]) -> Vec<u8> {
280 let mut buf = Vec::with_capacity(pairs.len() * 32);
281 write_map_header(&mut buf, pairs.len());
282 for (k, v) in pairs {
283 write_kv_str(&mut buf, k, v);
284 }
285 buf
286}
287
288#[cfg(test)]
289mod tests {

Callers

nothing calls this directly

Calls 3

write_kv_strFunction · 0.85
write_map_headerFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected