(element_type: WasmType, value: WasmValue)
| 335 | } |
| 336 | |
| 337 | fn 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 | |
| 345 | impl Table { |
| 346 | #[inline] |