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

Method push

crates/wasmtime/src/runtime/component/resource_table.rs:155–161  ·  view source on GitHub ↗

Inserts a new value `T` into this table, returning a corresponding `Resource ` which can be used to refer to it after it was inserted.

(&mut self, entry: T)

Source from the content-addressed store, hash-verified

153 /// Inserts a new value `T` into this table, returning a corresponding
154 /// `Resource<T>` which can be used to refer to it after it was inserted.
155 pub fn push<T>(&mut self, entry: T) -> Result<Resource<T>, ResourceTableError>
156 where
157 T: Send + 'static,
158 {
159 let idx = self.push_(TableEntry::new(Box::new(entry), None))?;
160 Ok(Resource::new_own(idx))
161 }
162
163 /// Pop an index off of the free list, if it's not empty.
164 fn pop_free_list(&mut self) -> Option<usize> {

Callers 15

load_mapFunction · 0.45
push_flagsFunction · 0.45
runMethod · 0.45
resourceMethod · 0.45
definitionMethod · 0.45
instantiate_preMethod · 0.45
stub_itemMethod · 0.45
into_instanceMethod · 0.45
push_Method · 0.45
test_free_listFunction · 0.45
test_max_capacityFunction · 0.45

Calls 3

OkFunction · 0.85
push_Method · 0.80
newFunction · 0.50

Tested by 2

test_free_listFunction · 0.36
test_max_capacityFunction · 0.36