Host

Trait Host 

Source
pub trait Host: HostNetwork + Send {
    // Required method
    fn network_error_code(
        &mut self,
        err: Resource<Error>,
    ) -> impl Future<Output = Result<Option<ErrorCode>>> + Send;
}

Required Methods§

Source

fn network_error_code( &mut self, err: Resource<Error>, ) -> impl Future<Output = Result<Option<ErrorCode>>> + Send

Attempts to extract a network-related error-code from the stream error provided.

Stream operations which return stream-error::last-operation-failed have a payload with more information about the operation that failed. This payload can be passed through to this function to see if there’s network-related information about the error to return.

Note that this function is fallible because not all stream-related errors are network-related errors.

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 network_error_code( &mut self, err: Resource<Error>, ) -> impl Future<Output = Result<Option<ErrorCode>>> + Send

Attempts to extract a network-related error-code from the stream error provided.

Stream operations which return stream-error::last-operation-failed have a payload with more information about the operation that failed. This payload can be passed through to this function to see if there’s network-related information about the error to return.

Note that this function is fallible because not all stream-related errors are network-related errors.

Implementors§