I'm using no-std and the component model and right now component-model-async requires std but the async feature doesn't. Also Component::LinkerInstance::func_wrap_async only requires the asyncfeature. So my idea to put some async functionality was to:
wit_bindgen::generate add an unsafe extern "C" {} block with the async functionslinker.root().func_wrap_async to provide the function. Can you describe more what you're trying to do? Without an error message or a reproduction it's tough to reach a conclusion such as "yeah this isn't supported" vs "oh just tweak this that's a minor configuration error" or anything inbetween
Basically, I was trying to turn this kind of (rust) file into a component:
// imports
wit_bindgen::generate("world");
// implement Guest Trait etc...
#[link(wasm_import_module = "foo")]
unsafe extern "C" {
fn bar();
}
The reason why I'm trying to do this is to manually bind "[foo]bar" using component::Linker::func_wrap_aysnc to circumvent using the component-model-async feature.
In any case, compiling such a file to Wasm works but running wasm-tools component new fails with
Caused by:
0: failed to decode world from module
1: module was not valid
2: failed to resolve import `foo::bar`
3: module requires an import interface named `foo`
The component model doesn't support importing/exporting core wasm functions: you have to wrap the function in a component export instead.
I'm not sure I entirely follow what you're trying to do wrt async, but note that you can in principle generate C bindings for your interface and then implement them in largely the same way you're trying to use core wasm functions here
Last updated: Dec 06 2025 at 06:05 UTC