wasmer

Trait HostFunction

Source
pub trait HostFunction<T, Args, Rets, Kind>
where Args: WasmTypeList, Rets: WasmTypeList, Kind: HostFunctionKind,
{ // Required method fn function_callback(&self) -> *const VMFunctionBody; // Provided method fn call_trampoline_address() -> VMTrampoline { ... } }
Expand description

The HostFunction trait represents the set of functions that can be used as host function. To uphold this statement, it is necessary for a function to be transformed into a VMFunctionCallback.

Required Methods§

Source

fn function_callback(&self) -> *const VMFunctionBody

Get the pointer to the function body.

Provided Methods§

Source

fn call_trampoline_address() -> VMTrampoline

Get the pointer to the function call trampoline.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§