Stream: wit-bindgen

Topic: wit-bindgen and `Lower` on records


view this post on Zulip Surma (Mar 03 2023 at 17:21):

I am trying to use preview2 of WASI and working on implementing wasi-io::write(this: output-stream, buf: list<u8>) -> result<u64, stream-error>. stream-error is currently defined as (record) (see here, and as such wit-bindgen generates struct StreamError {}. However, it seems that the struct does not implement Lower, which means I cannot use it in wasmtime::LinkerInstance::func_wrap(). Am I doing something wrong or has that just not been implemented yet?

the trait `wasmtime::component::Lower` is not implemented for `wasi_io::StreamError`
Polyfill adapter for preview1-using wasm modules to call preview2 functions. - preview2-prototyping/wasi-io.wit.md at main · bytecodealliance/preview2-prototyping

view this post on Zulip Surma (Mar 03 2023 at 17:31):

Oooh I just now realized that Lower is not _actually_ an empty trait. I guess I can just manually implement it for now (esp. for an empty struct)


Last updated: Oct 23 2024 at 20:03 UTC