wasmer/lib/runtime-core
bors[bot] 0790ebff0c
Merge #803
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>
2019-09-19 20:55:09 +00:00
..
2019-09-19 20:55:09 +00:00
2019-03-29 10:17:24 +01:00

Wasmer logo

Build Status License Join the Wasmer Community Number of downloads from crates.io Read our API documentation

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.