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

Function table_value_to_element

crates/tinywasm/src/reference.rs:337–343  ·  view source on GitHub ↗
(element_type: WasmType, value: WasmValue)

Source from the content-addressed store, hash-verified

335}
336
337fn table_value_to_element(element_type: WasmType, value: WasmValue) -> Result<TableElement, Trap> {
338 match (element_type, value) {
339 (WasmType::RefFunc, WasmValue::RefFunc(func_ref)) => Ok(TableElement::from(func_ref.addr())),
340 (WasmType::RefExtern, WasmValue::RefExtern(extern_ref)) => Ok(TableElement::from(extern_ref.addr())),
341 _ => Err(Trap::Other("invalid table value type")),
342 }
343}
344
345impl Table {
346 #[inline]

Callers 2

setMethod · 0.85
growMethod · 0.85

Calls 1

addrMethod · 0.45

Tested by

no test coverage detected