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

Method new

rust/src/iteration.rs:103–119  ·  view source on GitHub ↗
(tree: &'a BPlusTreeMap<K, V>)

Source from the content-addressed store, hash-verified

101
102impl<'a, K: Ord + Clone, V: Clone> ItemIterator<'a, K, V> {
103 pub fn new(tree: &'a BPlusTreeMap<K, V>) -> Self {
104 // Start with the first (leftmost) leaf in the tree
105 let leftmost_id = tree.get_first_leaf_id();
106
107 // Get the initial leaf reference if we have a starting leaf
108 let current_leaf_ref = leftmost_id.and_then(|id| tree.get_leaf(id));
109
110 Self {
111 tree,
112 current_leaf_id: leftmost_id,
113 current_leaf_ref,
114 current_leaf_index: 0,
115 end_key: None,
116 end_bound_key: None,
117 end_inclusive: false,
118 }
119 }
120
121 pub fn new_from_position_with_bounds(
122 tree: &'a BPlusTreeMap<K, V>,

Callers

nothing calls this directly

Calls 3

get_first_leaf_idMethod · 0.80
get_leafMethod · 0.80
get_leaf_uncheckedMethod · 0.80

Tested by

no test coverage detected