wasmtime_wasi::bindings::sockets::network

Trait Host

source
pub trait Host: Send + HostNetwork {
    // Required methods
    fn network_error_code(
        &mut self,
        err: Resource<Error>,
    ) -> Result<Option<ErrorCode>>;
    fn convert_error_code(&mut self, err: SocketError) -> Result<ErrorCode>;
}

Required Methods§

source

fn network_error_code( &mut self, err: Resource<Error>, ) -> Result<Option<ErrorCode>>

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.

source

fn convert_error_code(&mut self, err: SocketError) -> Result<ErrorCode>

Implementations on Foreign Types§

source§

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

source§

fn network_error_code( &mut self, err: Resource<Error>, ) -> Result<Option<ErrorCode>>

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.

source§

fn convert_error_code(&mut self, err: SocketError) -> Result<ErrorCode>

Implementors§

source§

impl<T> Host for WasiImpl<T>
where T: WasiView,