Insert `key, value` into the map and return the old value stored for `key`, if any.
(
&mut self,
key: K,
value: V,
forest: &mut MapForest<K, V>,
comp: &C,
)
| 131 | |
| 132 | /// Insert `key, value` into the map and return the old value stored for `key`, if any. |
| 133 | pub fn insert<C: Comparator<K>>( |
| 134 | &mut self, |
| 135 | key: K, |
| 136 | value: V, |
| 137 | forest: &mut MapForest<K, V>, |
| 138 | comp: &C, |
| 139 | ) -> Option<V> { |
| 140 | self.cursor_mut(forest, comp).insert(key, value) |
| 141 | } |
| 142 | |
| 143 | /// Like `insert` but returns an error on allocation failure. |
| 144 | pub fn try_insert<C: Comparator<K>>( |