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

Method insert

cranelift/codegen/src/scoped_hash_map.rs:49–63  ·  view source on GitHub ↗

Sets the value of the entry with the `VacantEntry`'s key.

(self, value: V)

Source from the content-addressed store, hash-verified

47impl<'a, K, V> VacantEntry<'a, K, V> {
48 /// Sets the value of the entry with the `VacantEntry`'s key.
49 pub fn insert(self, value: V) {
50 let val = Val {
51 value,
52 level: self.depth,
53 generation: self.generation,
54 };
55 match self.entry {
56 InsertLoc::Vacant(v) => {
57 v.insert(val);
58 }
59 InsertLoc::Occupied(mut o) => {
60 *o.get_mut() = val;
61 }
62 }
63 }
64}
65
66/// A view into a single entry in a map, which may either be vacant or occupied.

Callers 3

insert_with_depthMethod · 0.45
basicFunction · 0.45

Calls 1

get_mutMethod · 0.45

Tested by 1

basicFunction · 0.36