linera_witty

Trait ExportFunction

Source
pub trait ExportFunction<Handler, Parameters, Results> {
    // Required method
    fn export(
        &mut self,
        module_name: &str,
        function_name: &str,
        handler: Handler,
    ) -> Result<(), RuntimeError>;
}
Expand description

A type that accepts registering a host function as an export for a guest Wasm instance.

The Handler represents the closure type required for the host function, and Parameters and Results are the input and output types of the closure, respectively.

Required Methods§

Source

fn export( &mut self, module_name: &str, function_name: &str, handler: Handler, ) -> Result<(), RuntimeError>

Registers a host function executed by the handler with the provided module_name and function_name as an export for a guest Wasm instance.

Implementors§