pub type HostImportDescriptor = HostImportDescriptor<WasmtimeWasmBackend>;

Aliased Type§

struct HostImportDescriptor {
    pub host_exported_func: Box<dyn for<'c> Fn(&mut WasmtimeImportCallContext<'c>, Vec<IValue>) -> Option<IValue> + Sync + Send>,
    pub argument_types: Vec<IType>,
    pub output_type: Option<IType>,
    pub error_handler: Option<Box<dyn Fn(&HostImportError) -> Option<IValue> + Sync + Send>>,
}

Fields§

§host_exported_func: Box<dyn for<'c> Fn(&mut WasmtimeImportCallContext<'c>, Vec<IValue>) -> Option<IValue> + Sync + Send>

This closure will be invoked for corresponding import.

§argument_types: Vec<IType>

Type of the closure arguments.

§output_type: Option<IType>

Types of output of the closure.

§error_handler: Option<Box<dyn Fn(&HostImportError) -> Option<IValue> + Sync + Send>>

If Some, this closure is called with error when errors is encountered while lifting. If None, panic will occur.