Hi, I am trying to use some of the new async support to expose a sqlite interface to a rust wasm app. The async support is, overall, amazing! However, I am running into problems because the wit-bindgen generated wrappers are not Send, as their futures store some *mut u8 internally. That is an issue because Axum, which I am using to do some HTTP routing, has a Handler trait which requires Send.
I can work around this by doing the call to the generated wrapper inside of a wit_bindgen::spawn and then sending the result back over a oneshot channel but that's yucky. I am sure I do not appreciate the subtleties of this, but I am currently thinking that since components are currently single-threaded, marking everything as Send might be okay, and that would require some wrapper type around the *mut u8 marked as Send.
Curious to hear thoughts and suggestions. Thanks
Oh this is definitely a bug and we should be able to mark things as Send, if you're up for it I'm happy to review a PR to the generated bindings to ensure this
Great, thanks, I will see if I can get my head around the codegen :)
I submitted https://github.com/bytecodealliance/wit-bindgen/pull/1405. Feedback on style and substance very welcome
Last updated: Dec 06 2025 at 07:03 UTC