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

Function encode_coord_key

nodedb-array/src/query/retention.rs:48–53  ·  view source on GitHub ↗

Encode a coordinate vector into a stable byte key for HashMap / HashSet use. Uses the same zerompk encoding as the write path so keys are comparable across tile-versions.

(coord: &[CoordValue])

Source from the content-addressed store, hash-verified

46/// Uses the same zerompk encoding as the write path so keys are comparable
47/// across tile-versions.
48pub fn encode_coord_key(coord: &[CoordValue]) -> ArrayResult<Vec<u8>> {
49 let owned = coord.to_vec();
50 zerompk::to_msgpack_vec(&owned).map_err(|e| ArrayError::SegmentCorruption {
51 detail: format!("encode_coord_key: {e}"),
52 })
53}
54
55// ── Row iteration helper ─────────────────────────────────────────────────────
56

Callers 2

apply_retentionFunction · 0.85
decode_sparse_rowsFunction · 0.85

Calls 1

to_vecMethod · 0.45

Tested by

no test coverage detected