(element_type: WasmType, element: TableElement)
| 327 | } |
| 328 | |
| 329 | fn 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 | |
| 337 | fn table_value_to_element(element_type: WasmType, value: WasmValue) -> Result<TableElement, Trap> { |
| 338 | match (element_type, value) { |