Skip to main content

HostModule

Trait HostModule 

Source
pub trait HostModule: Send {
    // Required methods
    fn bytecode(
        &mut self,
        self_: Resource<Module>,
    ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send;
    fn add_breakpoint(
        &mut self,
        self_: Resource<Module>,
        d: Resource<Debuggee>,
        pc: u32,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn remove_breakpoint(
        &mut self,
        self_: Resource<Module>,
        d: Resource<Debuggee>,
        pc: u32,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn clone(
        &mut self,
        self_: Resource<Module>,
    ) -> impl Future<Output = Result<Resource<Module>>> + Send;
    fn unique_id(
        &mut self,
        self_: Resource<Module>,
    ) -> impl Future<Output = Result<u64>> + Send;
    fn drop(
        &mut self,
        rep: Resource<Module>,
    ) -> impl Future<Output = Result<()>> + Send;
}

Required Methods§

Source

fn bytecode( &mut self, self_: Resource<Module>, ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send

Get the original Wasm bytecode for this module, if available.

Source

fn add_breakpoint( &mut self, self_: Resource<Module>, d: Resource<Debuggee>, pc: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Add a breakpoint.

Source

fn remove_breakpoint( &mut self, self_: Resource<Module>, d: Resource<Debuggee>, pc: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Remove a breakpoint.

Source

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

Clone this handle.

Source

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

Get the unique ID of this module to allow equality and hashing.

Source

fn drop( &mut self, rep: Resource<Module>, ) -> 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 HostModule for ResourceTable

Source§

async fn add_breakpoint( &mut self, self_: Resource<Module>, d: Resource<Debuggee>, pc: u32, ) -> Result<()>

Source§

async fn remove_breakpoint( &mut self, self_: Resource<Module>, d: Resource<Debuggee>, pc: u32, ) -> Result<()>

Source§

async fn bytecode(&mut self, self_: Resource<Module>) -> Result<Option<Vec<u8>>>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn bytecode( &mut self, self_: Resource<Module>, ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send

Get the original Wasm bytecode for this module, if available.

Source§

fn add_breakpoint( &mut self, self_: Resource<Module>, d: Resource<Debuggee>, pc: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Add a breakpoint.

Source§

fn remove_breakpoint( &mut self, self_: Resource<Module>, d: Resource<Debuggee>, pc: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Remove a breakpoint.

Source§

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

Clone this handle.

Source§

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

Get the unique ID of this module to allow equality and hashing.

Source§

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

Implementors§