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

Function response_encode_msgpack

nodedb/src/control/server/native/codec.rs:178–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176
177 #[test]
178 fn response_encode_msgpack() {
179 let resp = NativeResponse::from_query_result(
180 5,
181 nodedb_types::result::QueryResult {
182 columns: vec!["x".into()],
183 rows: vec![vec![Value::Integer(42)]],
184 rows_affected: 0,
185 },
186 100,
187 );
188 let bytes = encode_response(&resp, FrameFormat::MessagePack).unwrap();
189 let decoded: NativeResponse = zerompk::from_msgpack(&bytes).unwrap();
190 assert_eq!(decoded.seq, 5);
191 assert_eq!(decoded.watermark_lsn, 100);
192 }
193
194 #[tokio::test]
195 async fn frame_read_write_roundtrip() {

Callers

nothing calls this directly

Calls 1

encode_responseFunction · 0.70

Tested by

no test coverage detected