MCPcopy Create free account
hub / github.com/cosdata/cosdata / find_node

Method find_node

src/models/inverted_index.rs:260–270  ·  view source on GitHub ↗

Finds the node at a given dimension Traverses the tree iteratively and returns a reference to the node.

(&self, dim_index: u32)

Source from the content-addressed store, hash-verified

258 /// Finds the node at a given dimension
259 /// Traverses the tree iteratively and returns a reference to the node.
260 pub fn find_node(&self, dim_index: u32) -> Option<&InvertedIndexNode> {
261 let mut current_node = &self.root;
262 let path = calculate_path(dim_index, self.root.dim_index);
263 for child_index in path {
264 let child = current_node.children.get(child_index as usize)?;
265 let node_res = unsafe { &*child };
266 current_node = node_res;
267 }
268
269 Some(current_node)
270 }
271
272 // Inserts vec_id, quantized value u8 at particular node based on path
273 pub fn insert(

Callers 1

deleteMethod · 0.45

Calls 2

calculate_pathFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected