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

Function encode_op

nodedb-array/src/sync/op_codec.rs:12–16  ·  view source on GitHub ↗

Encode a single [`ArrayOp`] to MessagePack bytes.

(op: &ArrayOp)

Source from the content-addressed store, hash-verified

10
11/// Encode a single [`ArrayOp`] to MessagePack bytes.
12pub fn encode_op(op: &ArrayOp) -> ArrayResult<Vec<u8>> {
13 zerompk::to_msgpack_vec(op).map_err(|e| ArrayError::SegmentCorruption {
14 detail: format!("encode_op: {e}"),
15 })
16}
17
18/// Decode a single [`ArrayOp`] from MessagePack bytes.
19pub fn decode_op(bytes: &[u8]) -> ArrayResult<ArrayOp> {

Callers 11

put_deltaFunction · 0.85
put_deltaFunction · 0.85
put_deltaFunction · 0.85
put_deltaFunction · 0.85
stream_opsMethod · 0.85
appendMethod · 0.85
handle_snapshot_chunkMethod · 0.85
deliver_opMethod · 0.85
roundtrip_putFunction · 0.85
roundtrip_deleteFunction · 0.85
roundtrip_eraseFunction · 0.85

Calls

no outgoing calls

Tested by 7

put_deltaFunction · 0.68
put_deltaFunction · 0.68
put_deltaFunction · 0.68
put_deltaFunction · 0.68
roundtrip_putFunction · 0.68
roundtrip_deleteFunction · 0.68
roundtrip_eraseFunction · 0.68