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

Function decode_snapshot

nodedb-array/src/sync/snapshot.rs:138–142  ·  view source on GitHub ↗

Decode a [`TileSnapshot`] from MessagePack bytes produced by [`encode_snapshot`]. Errors map to [`ArrayError::SegmentCorruption`].

(b: &[u8])

Source from the content-addressed store, hash-verified

136///
137/// Errors map to [`ArrayError::SegmentCorruption`].
138pub fn decode_snapshot(b: &[u8]) -> ArrayResult<TileSnapshot> {
139 zerompk::from_msgpack(b).map_err(|e| ArrayError::SegmentCorruption {
140 detail: format!("snapshot decode failed: {e}"),
141 })
142}
143
144// ─── Chunking ────────────────────────────────────────────────────────────────
145

Callers 3

getMethod · 0.85
latest_for_arrayMethod · 0.85
tile_snapshot_roundtripFunction · 0.85

Calls

no outgoing calls

Tested by 1

tile_snapshot_roundtripFunction · 0.68