Deprecate Instance::func and Instance::dyn_func

This commit is contained in:
Mark McCaskey
2020-03-26 17:11:37 -07:00
parent a18371eb91
commit 2fb8f8197b
7 changed files with 154 additions and 101 deletions

View File

@ -1,6 +1,6 @@
/// This example demonstrates the use of callbacks: calling functions (Host and Wasm)
/// passed to us from the Wasm via hostcall
use wasmer_runtime::{compile_with, compiler_for_backend, func, imports, Backend, Ctx};
use wasmer_runtime::{compile_with, compiler_for_backend, func, imports, Backend, Ctx, Func};
use wasmer_runtime_core::{structures::TypedIndex, types::TableIndex};
static WASM: &'static str = "examples/callback-guest/callback-guest.wasm";
@ -40,7 +40,7 @@ fn main() {
.instantiate(&imports)
.expect("failed to instantiate wasm module");
let entry_point = instance.func::<(u32, u32), u32>("main").unwrap();
let entry_point: Func<(u32, u32), u32> = instance.exports.get("main").unwrap();
entry_point.call(0, 0).expect("START");
}