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

Method entries

nodedb-spatial/src/rtree/tree.rs:85–93  ·  view source on GitHub ↗

Get all entries (for persistence serialization).

(&self)

Source from the content-addressed store, hash-verified

83
84 /// Get all entries (for persistence serialization).
85 pub fn entries(&self) -> Vec<&RTreeEntry> {
86 let _guard = self.governor().and_then(|gov| {
87 let bytes = self.len * std::mem::size_of::<*const RTreeEntry>();
88 gov.reserve(nodedb_mem::EngineId::Spatial, bytes).ok()
89 });
90 let mut result = Vec::with_capacity(self.len);
91 collect_entries(&self.nodes, self.root, &mut result);
92 result
93 }
94
95 /// Find parent of a node by traversal from root.
96 pub(crate) fn find_parent(&self, current: usize, target: usize) -> Option<usize> {

Callers 3

checkpoint_to_bytesMethod · 0.45
insertMethod · 0.45
dot_product_topkFunction · 0.45

Calls 4

collect_entriesFunction · 0.85
governorMethod · 0.80
okMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected