pub trait HostFunction<T, Args, Rets, Kind>where
Args: WasmTypeList,
Rets: WasmTypeList,
Kind: HostFunctionKind,{
// Required methods
fn function_callback(&self, rt: BackendKind) -> VMFunctionCallback;
fn call_trampoline_address() -> VMTrampoline;
// Provided method
fn function_callback_sys(&self) -> VMFunctionCallback { ... }
}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§
Sourcefn function_callback(&self, rt: BackendKind) -> VMFunctionCallback
fn function_callback(&self, rt: BackendKind) -> VMFunctionCallback
Get the pointer to the function body for a given runtime.
Sourcefn call_trampoline_address() -> VMTrampoline
fn call_trampoline_address() -> VMTrampoline
Get the pointer to the function call trampoline for a given runtime.
Provided Methods§
Sourcefn function_callback_sys(&self) -> VMFunctionCallback
fn function_callback_sys(&self) -> VMFunctionCallback
Get the pointer to the function body for a given runtime.
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.