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

Function encode

nodedb-query/src/msgpack_scan/reader.rs:457–459  ·  view source on GitHub ↗

Helper: encode a serde_json::Value to MessagePack bytes.

(v: &serde_json::Value)

Source from the content-addressed store, hash-verified

455
456 /// Helper: encode a serde_json::Value to MessagePack bytes.
457 fn encode(v: &serde_json::Value) -> Vec<u8> {
458 nodedb_types::json_msgpack::json_to_msgpack(v).expect("encode")
459 }
460
461 #[test]
462 fn skip_positive_fixint() {

Callers 15

skip_float64Function · 0.70
skip_stringFunction · 0.70
skip_mapFunction · 0.70
skip_nested_arrayFunction · 0.70
read_f64_float64Function · 0.70
read_f64_uint16Function · 0.70
read_i64_valuesFunction · 0.70
read_str_fixstrFunction · 0.70
read_str_str8Function · 0.70
map_header_fixmapFunction · 0.70
array_header_fixarrayFunction · 0.70

Calls 2

json_to_msgpackFunction · 0.50
expectMethod · 0.45

Tested by 15

skip_float64Function · 0.56
skip_stringFunction · 0.56
skip_mapFunction · 0.56
skip_nested_arrayFunction · 0.56
read_f64_float64Function · 0.56
read_f64_uint16Function · 0.56
read_i64_valuesFunction · 0.56
read_str_fixstrFunction · 0.56
read_str_str8Function · 0.56
map_header_fixmapFunction · 0.56
array_header_fixarrayFunction · 0.56