pub trait CallbackProvider {
    // Required methods
    fn do_host_send(&self, frame_bytes: Bytes) -> Result<(), Error>;
    fn do_console_log(&self, msg: &str);
    fn do_op_list(&self, bytes: Bytes) -> Result<(), Error>;
    fn do_host_init(
        &self,
        guest_buff_ptr: u32,
        host_buff_ptr: u32
    ) -> Result<(), Error>;
    fn get_import(&self, namespace: &str, operation: &str) -> Result<u32, Error>;
    fn get_export(&self, namespace: &str, operation: &str) -> Result<u32, Error>;
}
Expand description

The trait that a host needs to implement to satisfy wasmrs protocol imports and to query data about the loaded module.

Required Methods§

source

fn do_host_send(&self, frame_bytes: Bytes) -> Result<(), Error>

The callback for __wasmrs_send

source

fn do_console_log(&self, msg: &str)

source

fn do_op_list(&self, bytes: Bytes) -> Result<(), Error>

Query the operation list for the module.

source

fn do_host_init( &self, guest_buff_ptr: u32, host_buff_ptr: u32 ) -> Result<(), Error>

The callback for __wasmrs_init

source

fn get_import(&self, namespace: &str, operation: &str) -> Result<u32, Error>

Find an import id by namespace and operation.

source

fn get_export(&self, namespace: &str, operation: &str) -> Result<u32, Error>

Find an export id by namespace and operation.

Implementors§