alexcrichton commented on Issue #463:
I'm going to now that we've temporarily removed interface types support, but stay tuned to https://github.com/bytecodealliance/wasmtime/issues/677 for future updates!
alexcrichton closed Issue #463:
As far as I can tell, there currently is no straightforward way to transfer
Vec<T>
types from a wasm module to the host. It would be desirable to let exported functions return other structured types, than those already supported, like so:#[wasmtime_rust::wasmtime] pub trait Module { fn test1(&mut self) -> Vec<f32>; fn test2(&mut self) -> [f32; 3]; fn test3(&mut self) -> CustomType; } #[wasm_bindgen] struct CustomType([f32; 3]);The minimal implementation would add
Vec<T> where T: wasmtime_interface_types::Value
as a supported type. This would allowCustomType
and other types to be serialized toVec<u8>
and passed through the ABI.
Last updated: Dec 23 2024 at 13:07 UTC