Skip to content

Conversation

@Tam1SH
Copy link

@Tam1SH Tam1SH commented Nov 23, 2025

Spent an hour figuring out that the documentation was missing this crucial detail :)

@Tam1SH Tam1SH requested a review from a team as a code owner November 23, 2025 11:32
@Tam1SH Tam1SH requested review from dicej and removed request for a team November 23, 2025 11:32
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Nov 23, 2025
Copy link
Contributor

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! LGTM, but please see the inline comment.

Comment on lines -87 to +90
linker.func_wrap("host", "host_func", |caller: Caller<'_, u32>, param: i32| {
linker.root().instance("host").func_wrap("host_func", |ctx: StoreContextMut<'_, ()>, (param,): (i32,)| {
println!("Got {} from WebAssembly", param);
println!("my host state is: {}", caller.data());
println!("my host state is: {}", ctx.data());
Ok(())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example here is for core wasm, not components, so this'll need to stay as it was before. You can add (or link) a different example for components though

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants