Insert the key-value pair at the current position. The current position must be the correct insertion location for the key. This function does not check for duplicate keys. Use `find` or similar for that. Returns the new root node.
(
&mut self,
key: F::Key,
value: F::Value,
pool: &mut NodePool<F>,
)
| 262 | /// This function does not check for duplicate keys. Use `find` or similar for that. |
| 263 | /// Returns the new root node. |
| 264 | pub fn insert( |
| 265 | &mut self, |
| 266 | key: F::Key, |
| 267 | value: F::Value, |
| 268 | pool: &mut NodePool<F>, |
| 269 | ) -> Result<Node, OutOfMemory> { |
| 270 | if !self.try_leaf_insert(key, value, pool) { |
| 271 | self.split_and_insert(key, value, pool)?; |
| 272 | } |
| 273 | Ok(self.node[0]) |
| 274 | } |
| 275 | |
| 276 | /// Try to insert `key, value` at the current position, but fail and return false if the leaf |
| 277 | /// node is full. |
nothing calls this directly
no test coverage detected