MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / get

Method get

crates/tinywasm/src/store/table.rs:52–58  ·  view source on GitHub ↗
(&self, addr: TableAddr)

Source from the content-addressed store, hash-verified

50 }
51
52 pub(crate) fn get(&self, addr: TableAddr) -> Result<&TableElement, Trap> {
53 self.elements.get(addr as usize).ok_or(Trap::TableOutOfBounds {
54 offset: addr as usize,
55 len: 1,
56 max: self.elements.len(),
57 })
58 }
59
60 pub(crate) fn copy_from_slice(&mut self, dst: usize, src: &[TableElement]) -> Result<(), Trap> {
61 let end = dst.checked_add(src.len()).ok_or_else(|| self.trap_oob(dst, src.len()))?;

Callers 15

get_module_instanceMethod · 0.45
get_funcMethod · 0.45
get_wasm_funcMethod · 0.45
get_memMethod · 0.45
get_tableMethod · 0.45
get_globalMethod · 0.45
get_global_valMethod · 0.45
elem_addrMethod · 0.45
init_elementsMethod · 0.45
init_dataMethod · 0.45
eval_constMethod · 0.45

Calls 1

lenMethod · 0.45

Tested by 2

test_set_and_getFunction · 0.36
test_table_initFunction · 0.36