Skip to main content

HostInstance

Trait HostInstance 

Source
pub trait HostInstance: Send {
    // Required methods
    fn get_module(
        &mut self,
        self_: Resource<Instance>,
        d: Resource<Debuggee>,
    ) -> impl Future<Output = Result<Resource<Module>>> + Send;
    fn get_memory(
        &mut self,
        self_: Resource<Instance>,
        d: Resource<Debuggee>,
        memory_index: u32,
    ) -> impl Future<Output = Result<Resource<Memory>, Error>> + Send;
    fn get_global(
        &mut self,
        self_: Resource<Instance>,
        d: Resource<Debuggee>,
        global_index: u32,
    ) -> impl Future<Output = Result<Resource<Global>, Error>> + Send;
    fn get_table(
        &mut self,
        self_: Resource<Instance>,
        d: Resource<Debuggee>,
        table_index: u32,
    ) -> impl Future<Output = Result<Resource<Table>, Error>> + Send;
    fn get_func(
        &mut self,
        self_: Resource<Instance>,
        d: Resource<Debuggee>,
        func_index: u32,
    ) -> impl Future<Output = Result<Resource<WasmFunc>, Error>> + Send;
    fn get_tag(
        &mut self,
        self_: Resource<Instance>,
        d: Resource<Debuggee>,
        tag_index: u32,
    ) -> impl Future<Output = Result<Resource<WasmTag>, Error>> + Send;
    fn clone(
        &mut self,
        self_: Resource<Instance>,
    ) -> impl Future<Output = Result<Resource<Instance>>> + Send;
    fn unique_id(
        &mut self,
        self_: Resource<Instance>,
    ) -> impl Future<Output = Result<u64>> + Send;
    fn drop(
        &mut self,
        rep: Resource<Instance>,
    ) -> impl Future<Output = Result<()>> + Send;
}

Required Methods§

Source

fn get_module( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<Resource<Module>>> + Send

Get this instance’s module.

Source

fn get_memory( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, memory_index: u32, ) -> impl Future<Output = Result<Resource<Memory>, Error>> + Send

Get a memory from this instance’s memory index space.

Source

fn get_global( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, global_index: u32, ) -> impl Future<Output = Result<Resource<Global>, Error>> + Send

Get a global from this instance’s global index space.

Source

fn get_table( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, table_index: u32, ) -> impl Future<Output = Result<Resource<Table>, Error>> + Send

Get a table from this instance’s table index space.

Source

fn get_func( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, func_index: u32, ) -> impl Future<Output = Result<Resource<WasmFunc>, Error>> + Send

Get a function from this instance’s function index space.

Source

fn get_tag( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, tag_index: u32, ) -> impl Future<Output = Result<Resource<WasmTag>, Error>> + Send

Get a tag from this instance’s tag index space.

Source

fn clone( &mut self, self_: Resource<Instance>, ) -> impl Future<Output = Result<Resource<Instance>>> + Send

Clone this handle.

Source

fn unique_id( &mut self, self_: Resource<Instance>, ) -> impl Future<Output = Result<u64>> + Send

Get the unique ID of this instance (within the debuggee) to allow equality and hashing.

Source

fn drop( &mut self, rep: Resource<Instance>, ) -> impl Future<Output = Result<()>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HostInstance for ResourceTable

Source§

async fn get_module( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, ) -> Result<Resource<Module>>

Source§

async fn get_memory( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, memory_index: u32, ) -> Result<Resource<Memory>>

Source§

async fn get_global( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, global_index: u32, ) -> Result<Resource<Global>>

Source§

async fn get_table( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, table_index: u32, ) -> Result<Resource<Table>>

Source§

async fn get_func( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, func_index: u32, ) -> Result<Resource<Func>>

Source§

async fn get_tag( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, tag_index: u32, ) -> Result<Resource<Tag>>

Source§

async fn clone( &mut self, self_: Resource<Instance>, ) -> Result<Resource<Instance>>

Source§

async fn unique_id(&mut self, self_: Resource<Instance>) -> Result<u64>

Source§

async fn drop(&mut self, rep: Resource<Instance>) -> Result<()>

Source§

impl<_T: HostInstance + ?Sized + Send> HostInstance for &mut _T

Source§

fn get_module( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<Resource<Module>>> + Send

Get this instance’s module.

Source§

fn get_memory( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, memory_index: u32, ) -> impl Future<Output = Result<Resource<Memory>, Error>> + Send

Get a memory from this instance’s memory index space.

Source§

fn get_global( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, global_index: u32, ) -> impl Future<Output = Result<Resource<Global>, Error>> + Send

Get a global from this instance’s global index space.

Source§

fn get_table( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, table_index: u32, ) -> impl Future<Output = Result<Resource<Table>, Error>> + Send

Get a table from this instance’s table index space.

Source§

fn get_func( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, func_index: u32, ) -> impl Future<Output = Result<Resource<WasmFunc>, Error>> + Send

Get a function from this instance’s function index space.

Source§

fn get_tag( &mut self, self_: Resource<Instance>, d: Resource<Debuggee>, tag_index: u32, ) -> impl Future<Output = Result<Resource<WasmTag>, Error>> + Send

Get a tag from this instance’s tag index space.

Source§

fn clone( &mut self, self_: Resource<Instance>, ) -> impl Future<Output = Result<Resource<Instance>>> + Send

Clone this handle.

Source§

fn unique_id( &mut self, self_: Resource<Instance>, ) -> impl Future<Output = Result<u64>> + Send

Get the unique ID of this instance (within the debuggee) to allow equality and hashing.

Source§

async fn drop(&mut self, rep: Resource<Instance>) -> Result<()>

Implementors§