Move this path to the next key-value pair and return it.
(&mut self, pool: &NodePool<F>)
| 106 | |
| 107 | /// Move this path to the next key-value pair and return it. |
| 108 | pub fn next(&mut self, pool: &NodePool<F>) -> Option<(F::Key, F::Value)> { |
| 109 | match self.leaf_pos() { |
| 110 | None => return None, |
| 111 | Some((node, entry)) => { |
| 112 | let (keys, vals) = pool[node].unwrap_leaf(); |
| 113 | if entry + 1 < keys.len() { |
| 114 | self.entry[self.size - 1] += 1; |
| 115 | return Some((keys[entry + 1], vals[entry + 1])); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // The current leaf node is exhausted. Move to the next one. |
| 121 | let leaf_level = self.size - 1; |
| 122 | self.next_node(leaf_level, pool).map(|node| { |
| 123 | let (keys, vals) = pool[node].unwrap_leaf(); |
| 124 | (keys[0], vals[0]) |
| 125 | }) |
| 126 | } |
| 127 | |
| 128 | /// Move this path to the previous key-value pair and return it. |
| 129 | /// |
nothing calls this directly
no test coverage detected