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

Method try_insert

cranelift/bforest/src/set.rs:117–124  ·  view source on GitHub ↗

Like `insert` but returns an error on allocation failure.

(
        &mut self,
        key: K,
        forest: &mut SetForest<K>,
        comp: &C,
    )

Source from the content-addressed store, hash-verified

115
116 /// Like `insert` but returns an error on allocation failure.
117 pub fn try_insert<C: Comparator<K>>(
118 &mut self,
119 key: K,
120 forest: &mut SetForest<K>,
121 comp: &C,
122 ) -> Result<bool, OutOfMemory> {
123 self.cursor(forest, comp).try_insert(key)
124 }
125
126 /// Remove `key` from the set and return true.
127 ///

Callers 1

insertMethod · 0.45

Calls 10

leafFunction · 0.85
SetValueClass · 0.85
OkFunction · 0.85
alloc_nodeMethod · 0.80
set_root_nodeMethod · 0.80
cursorMethod · 0.45
expandMethod · 0.45
is_noneMethod · 0.45
findMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected