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

Method to_msgpack

nodedb/src/engine/graph/algo/result.rs:158–162  ·  view source on GitHub ↗

Serialize the result batch as MessagePack bytes. Writes directly to MessagePack without building intermediate `serde_json::Value` objects. The Control Plane converts to JSON via `decode_payload_to_json()` for pgwire/REST responses. Format: msgpack array of maps, e.g. `[{"node_id": "alice", "rank": 0.42}, ...]`.

(&self)

Source from the content-addressed store, hash-verified

156 ///
157 /// Format: msgpack array of maps, e.g. `[{"node_id": "alice", "rank": 0.42}, ...]`.
158 pub fn to_msgpack(&self) -> Result<Vec<u8>, crate::Error> {
159 zerompk::to_msgpack_vec(self).map_err(|e| crate::Error::Internal {
160 detail: format!("msgpack serialization: {e}"),
161 })
162 }
163
164 /// Serialize the result batch as JSON (for pgwire/REST response).
165 ///

Callers 3

execute_graph_algoMethod · 0.45
run_algo_responseFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected