Try to insert `key, value` at the current position, but fail and return false if the leaf node is full.
(&self, key: F::Key, value: F::Value, pool: &mut NodePool<F>)
| 276 | /// Try to insert `key, value` at the current position, but fail and return false if the leaf |
| 277 | /// node is full. |
| 278 | fn try_leaf_insert(&self, key: F::Key, value: F::Value, pool: &mut NodePool<F>) -> bool { |
| 279 | let index = self.leaf_entry(); |
| 280 | |
| 281 | // The case `index == 0` should only ever happen when there are no earlier leaf nodes, |
| 282 | // otherwise we should have appended to the previous leaf node instead. This invariant |
| 283 | // means that we don't need to update keys stored in inner nodes here. |
| 284 | debug_assert!(index > 0 || self.at_first_entry()); |
| 285 | |
| 286 | pool[self.leaf_node()].try_leaf_insert(index, key, value) |
| 287 | } |
| 288 | |
| 289 | /// Split the current leaf node and then insert `key, value`. |
| 290 | /// This should only be used if `try_leaf_insert()` fails. |
no test coverage detected