Skip to main content

HostFunction

Trait HostFunction 

Source
pub trait HostFunction: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute(
        &self,
        ctx: &mut HostFunctionContext,
        args: &[u8],
    ) -> HostCallResult;
    fn description(&self) -> &str;
}
Expand description

Trait for host function implementations

Each host function that WASM plugins can call implements this trait.

Required Methods§

Source

fn name(&self) -> &str

Function name as seen from WASM

Source

fn execute(&self, ctx: &mut HostFunctionContext, args: &[u8]) -> HostCallResult

Execute the function

Source

fn description(&self) -> &str

Human-readable description

Implementors§