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

Method insert

cranelift/bforest/src/set.rs:107–114  ·  view source on GitHub ↗

Try to insert `key` into the set. If the set did not contain `key`, insert it and return true. If `key` is already present, don't change the set and return false.

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

Source from the content-addressed store, hash-verified

105 ///
106 /// If `key` is already present, don't change the set and return false.
107 pub fn insert<C: Comparator<K>>(
108 &mut self,
109 key: K,
110 forest: &mut SetForest<K>,
111 comp: &C,
112 ) -> bool {
113 self.cursor(forest, comp).insert(key)
114 }
115
116 /// Like `insert` but returns an error on allocation failure.
117 pub fn try_insert<C: Comparator<K>>(

Callers 1

try_insertMethod · 0.45

Calls 3

panic_on_oomMethod · 0.80
cursorMethod · 0.45
try_insertMethod · 0.45

Tested by

no test coverage detected