LeoDreamer2004 opened issue #12016:
I'm working on a WebAssembly interface with an async function defined in WIT:
package allay:plugin@1.0.0; world plugin { export test: async func() -> string; }I'm using
wasmtime::component::bindgen!to generate the bindings:wasmtime::component::bindgen!({ path: "wit", world: "plugin" });When I try to call the
testfunction:let instance = Plugin::instantiate(&mut store, &component, &linker)?; instance.call_test().await?;I encountered an issue. After expanding the macros, I found that the signature of
call_testis:pub async fn call_test<T, D>(&self, accessor: &Accessor) -> Result<String>;Unlike
Store, theAccessortype cannot be directly constructed by the user. What should I do in this situation? I would appreciate any guidance on how to resolve this.Thanks in advance for your help!
Last updated: Dec 06 2025 at 07:03 UTC