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

Function rtree_storage_key

nodedb-spatial/src/persist.rs:228–236  ·  view source on GitHub ↗

Build the storage key for an R-tree checkpoint. Format: `{collection}\0{field}\0rtree`

(collection: &str, field: &str)

Source from the content-addressed store, hash-verified

226///
227/// Format: `{collection}\0{field}\0rtree`
228pub fn rtree_storage_key(collection: &str, field: &str) -> Vec<u8> {
229 let mut key = Vec::with_capacity(collection.len() + field.len() + 8);
230 key.extend_from_slice(collection.as_bytes());
231 key.push(0);
232 key.extend_from_slice(field.as_bytes());
233 key.push(0);
234 key.extend_from_slice(b"rtree");
235 key
236}
237
238/// Build the storage key for spatial index metadata.
239///

Callers 1

storage_key_formatFunction · 0.85

Calls 3

lenMethod · 0.45
as_bytesMethod · 0.45
pushMethod · 0.45

Tested by 1

storage_key_formatFunction · 0.68