MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / insert

Method insert

cranelift/bforest/src/map.rs:133–141  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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>>(

Callers 11

try_insertMethod · 0.45
full_leafFunction · 0.45
split_level0_leafFunction · 0.45
fullFunction · 0.45
split_level1_leafFunction · 0.45
two_leafFunction · 0.45
level3_sparseFunction · 0.45
immutable_cursorFunction · 0.45
into_iterFunction · 0.45
rangeFunction · 0.45
range_next_backFunction · 0.45

Calls 3

cursor_mutMethod · 0.80
panic_on_oomMethod · 0.80
try_insertMethod · 0.45

Tested by 6

split_level0_leafFunction · 0.36
split_level1_leafFunction · 0.36
immutable_cursorFunction · 0.36
into_iterFunction · 0.36
rangeFunction · 0.36
range_next_backFunction · 0.36