Trait wasmtime_wasi_http::bindings::http::types::Host

source ·
pub trait Host:
    Send
    + HostFields
    + HostIncomingRequest
    + HostOutgoingRequest
    + HostRequestOptions
    + HostResponseOutparam
    + HostIncomingResponse
    + HostIncomingBody
    + HostFutureTrailers
    + HostOutgoingResponse
    + HostOutgoingBody
    + HostFutureIncomingResponse {
    // Required methods
    fn http_error_code(
        &mut self,
        err: Resource<IoError>,
    ) -> Result<Option<ErrorCode>>;
    fn convert_error_code(&mut self, err: HttpError) -> Result<ErrorCode>;
}

Required Methods§

source

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

Attempts to extract a http-related error from the wasi:io error provided.

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

Note that this function is fallible because not all io-errors are http-related errors.

source

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

Implementations on Foreign Types§

source§

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

source§

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

Attempts to extract a http-related error from the wasi:io error provided.

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

Note that this function is fallible because not all io-errors are http-related errors.

source§

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

Implementors§

source§

impl<T> Host for WasiHttpImpl<T>
where T: WasiHttpView,