MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / find_child

Method find_child

rust/src/tree_structure.rs:219–224  ·  view source on GitHub ↗

Find the child index and `NodeRef` for `key` in the specified branch, returning `None` if the branch does not exist or index is out of range.

(&self, branch_id: NodeId, key: &K)

Source from the content-addressed store, hash-verified

217 /// Find the child index and `NodeRef` for `key` in the specified branch,
218 /// returning `None` if the branch does not exist or index is out of range.
219 pub fn find_child(&self, branch_id: NodeId, key: &K) -> Option<(usize, NodeRef<K, V>)> {
220 self.get_branch(branch_id).and_then(|branch| {
221 let idx = branch.find_child_index(key);
222 branch.children.get(idx).cloned().map(|child| (idx, child))
223 })
224 }
225
226 /// Mutable version of `find_child`.
227 pub fn find_child_mut(&mut self, branch_id: NodeId, key: &K) -> Option<(usize, NodeRef<K, V>)> {

Callers

nothing calls this directly

Calls 3

get_branchMethod · 0.80
find_child_indexMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected