Stream: git-wasmtime

Topic: wasmtime / issue #12016 How to create a `Accessor` for as...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2025 at 12:00):

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 test function:

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_test is:

pub async fn call_test<T, D>(&self, accessor: &Accessor) -> Result<String>;

Unlike Store, the Accessor type 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