Struct wasm3_provider::Wasm3EngineProvider
source · pub struct Wasm3EngineProvider { /* private fields */ }
Expand description
Wasm3EngineProvider implements the WebAssemblyEngineProvider trait and normalizes the interface to the wasm3 engine.
Implementations§
source§impl Wasm3EngineProvider
impl Wasm3EngineProvider
sourcepub fn new(buf: &[u8]) -> Wasm3EngineProvider
pub fn new(buf: &[u8]) -> Wasm3EngineProvider
Instantiate a new wasm3 provider with the supplied wasm module.
Trait Implementations§
source§impl WebAssemblyEngineProvider for Wasm3EngineProvider
impl WebAssemblyEngineProvider for Wasm3EngineProvider
source§fn init(
&mut self,
host: Arc<ModuleState>
) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
fn init( &mut self, host: Arc<ModuleState> ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
Tell the engine provider that it can do whatever processing it needs to do for
initialization and give it access to the module state
source§fn call(
&mut self,
op_length: i32,
msg_length: i32
) -> Result<i32, Box<dyn Error + Send + Sync + 'static>>
fn call( &mut self, op_length: i32, msg_length: i32 ) -> Result<i32, Box<dyn Error + Send + Sync + 'static>>
Trigger the waPC function call. Engine provider is responsible for execution and using the appropriate methods
on the module host. When this function is complete, the guest response and optionally the guest
error must be set to represent the high-level call result