Macro wasm3::make_func_wrapper [−][src]
macro_rules! make_func_wrapper {
($wis : vis $wrapper_name : ident : $original :
ident($($pname : ident : $ptype : ident), * $(,) ?) -> TrappedResult < $rtype
: ident >) => { ... };
($wis : vis $wrapper_name : ident : $original :
ident($($pname : ident : $ptype : ident), * $(,) ?) $(-> $rtype : ident) ?) => { ... };
}
Expand description
A convenience macro for creating a wrapper function that can be linked to wasm3.
Example
ⓘ
wasm3::make_func_wrapper!(millis_wrap: millis() -> u64);
fn millis() -> u64 {
MILLIS
}
module
.link_function::<(), u64>("time", "millis", millis_wrap)
.expect("Unable to link function");