[][src]Macro wasmer_runtime::imports

macro_rules! imports {
    ( $ ( $ ns_name : expr => $ ns : tt , ) * ) => { ... };
}

Generate an ImportObject safely.

Note:

The import macro currently only supports importing functions.

Usage:

let import_object = imports! {
    "env" => {
        "foo" => foo<[i32] -> [i32]>,
    },
};

extern fn foo(n: i32, _: &mut Ctx) -> i32 {
    n
}