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

Function decode_op

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

Decode a single [`ArrayOp`] from MessagePack bytes.

(bytes: &[u8])

Source from the content-addressed store, hash-verified

17
18/// Decode a single [`ArrayOp`] from MessagePack bytes.
19pub fn decode_op(bytes: &[u8]) -> ArrayResult<ArrayOp> {
20 zerompk::from_msgpack(bytes).map_err(|e| ArrayError::SegmentCorruption {
21 detail: format!("decode_op: {e}"),
22 })
23}
24
25/// Encode a slice of [`ArrayOp`]s as a single MessagePack value (array).
26pub fn encode_op_batch(ops: &[ArrayOp]) -> ArrayResult<Vec<u8>> {

Callers 8

handle_deltaMethod · 0.85
handle_delta_batchMethod · 0.85
scan_fromMethod · 0.85
scan_rangeMethod · 0.85
apply_array_opFunction · 0.85
roundtrip_putFunction · 0.85
roundtrip_deleteFunction · 0.85
roundtrip_eraseFunction · 0.85

Calls

no outgoing calls

Tested by 3

roundtrip_putFunction · 0.68
roundtrip_deleteFunction · 0.68
roundtrip_eraseFunction · 0.68