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

Function encode_json

nodedb/src/data/executor/response_codec/encode.rs:20–24  ·  view source on GitHub ↗

Encode a serde_json::Value payload as MessagePack bytes.

(value: &serde_json::Value)

Source from the content-addressed store, hash-verified

18
19/// Encode a serde_json::Value payload as MessagePack bytes.
20pub(in crate::data::executor) fn encode_json(value: &serde_json::Value) -> crate::Result<Vec<u8>> {
21 nodedb_types::json_to_msgpack(value).map_err(|e| crate::Error::Codec {
22 detail: format!("response serialization: {e}"),
23 })
24}
25
26/// Encode any `Serialize` type as MessagePack bytes.
27///

Callers 15

encode_serdeFunction · 0.85
execute_insert_selectMethod · 0.85
execute_bulk_updateMethod · 0.85
execute_bulk_deleteMethod · 0.85
convert_to_strictMethod · 0.85
execute_truncateMethod · 0.85

Calls 1

json_to_msgpackFunction · 0.50

Tested by

no test coverage detected