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

Method push

crates/environ/src/component/dfg.rs:573–581  ·  view source on GitHub ↗

Inserts the `value` specified into this set, returning either a fresh key `K` if this value hasn't been seen before or otherwise returning the previous `K` used to represent value. Note that this should only be used for component model items where the creation of `value` is not side-effectful.

(&mut self, value: V)

Source from the content-addressed store, hash-verified

571 /// Note that this should only be used for component model items where the
572 /// creation of `value` is not side-effectful.
573 pub fn push(&mut self, value: V) -> K
574 where
575 V: Hash + Eq + Clone,
576 {
577 *self
578 .intern_map
579 .entry(value.clone())
580 .or_insert_with(|| self.key_map.push(value))
581 }
582
583 /// Returns an iterator of all the values contained within this set.
584 pub fn iter(&self) -> impl Iterator<Item = (K, &V)> {

Callers 15

push_resource_tableMethod · 0.45
instantiateMethod · 0.45
resourceMethod · 0.45
exportMethod · 0.45
convert_optionsMethod · 0.45
trampolineMethod · 0.45
internMethod · 0.45
translate_payloadMethod · 0.45
alias_component_outerMethod · 0.45
flatten_typesMethod · 0.45

Calls 3

or_insert_withMethod · 0.80
entryMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected