mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-22 02:50:51 +00:00
803: Add method to call function at index on Ctx r=MarkMcCaskey a=MarkMcCaskey For #638 and #670 ```Rust fn call_guest_fn(ctx: &mut Ctx, guest_fn: u32) -> u32 { println!("{}", guest_fn); let guest_fn_typed = unsafe { std::mem::transmute(guest_fn) }; let result = ctx.call_with_table_index(guest_fn_typed, &[]).unwrap(); println!(" -> {:?}", result); 0 } ``` is what this looks like from the Host side See `examples/callback.rs` for an example that doesn't require `transmute` # Review - [x] Create a short description of the the change in the CHANGELOG.md file Co-authored-by: Mark McCaskey <mark@wasmer.io> Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
Wasmer Runtime Core
Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully compatible with Emscripten, Rust and Go. Learn more.
This crate represents the core of the runtime.