Host

Trait Host 

Source
pub trait Host: Send {
    // Required methods
    fn exit(
        &mut self,
        status: Result<(), ()>,
    ) -> impl Future<Output = Result<()>> + Send;
    fn exit_with_code(
        &mut self,
        status_code: u8,
    ) -> impl Future<Output = Result<()>> + Send;
}

Required Methods§

Source

fn exit( &mut self, status: Result<(), ()>, ) -> impl Future<Output = Result<()>> + Send

Exit the current instance and any linked instances.

Source

fn exit_with_code( &mut self, status_code: u8, ) -> impl Future<Output = Result<()>> + Send

Exit the current instance and any linked instances, reporting the specified status code to the host.

The meaning of the code depends on the context, with 0 usually meaning “success”, and other values indicating various types of failure.

This function does not return; the effect is analogous to a trap, but without the connotation that something bad has happened.

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<_T: Host + ?Sized + Send> Host for &mut _T

Source§

fn exit( &mut self, status: Result<(), ()>, ) -> impl Future<Output = Result<()>> + Send

Exit the current instance and any linked instances.

Source§

fn exit_with_code( &mut self, status_code: u8, ) -> impl Future<Output = Result<()>> + Send

Exit the current instance and any linked instances, reporting the specified status code to the host.

The meaning of the code depends on the context, with 0 usually meaning “success”, and other values indicating various types of failure.

This function does not return; the effect is analogous to a trap, but without the connotation that something bad has happened.

Implementors§