MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / table_element_to_value

Function table_element_to_value

crates/tinywasm/src/reference.rs:329–335  ·  view source on GitHub ↗
(element_type: WasmType, element: TableElement)

Source from the content-addressed store, hash-verified

327}
328
329fn table_element_to_value(element_type: WasmType, element: TableElement) -> WasmValue {
330 match element_type {
331 WasmType::RefFunc => WasmValue::RefFunc(FuncRef::new(element.addr())),
332 WasmType::RefExtern => WasmValue::RefExtern(ExternRef::new(element.addr())),
333 _ => unreachable!("table element type must be a reference type"),
334 }
335}
336
337fn table_value_to_element(element_type: WasmType, value: WasmValue) -> Result<TableElement, Trap> {
338 match (element_type, value) {

Callers 1

loadMethod · 0.85

Calls 1

addrMethod · 0.45

Tested by

no test coverage detected