wasmtime_wasi_http::bindings::http::types

Trait HostIncomingResponse

Source
pub trait HostIncomingResponse {
    // Required methods
    fn status(
        &mut self,
        self_: Resource<IncomingResponse>,
    ) -> Result<StatusCode>;
    fn headers(
        &mut self,
        self_: Resource<IncomingResponse>,
    ) -> Result<Resource<Headers>>;
    fn consume(
        &mut self,
        self_: Resource<IncomingResponse>,
    ) -> Result<Result<Resource<IncomingBody>, ()>>;
    fn drop(&mut self, rep: Resource<IncomingResponse>) -> Result<()>;
}

Required Methods§

Source

fn status(&mut self, self_: Resource<IncomingResponse>) -> Result<StatusCode>

Returns the status code from the incoming response.

Source

fn headers( &mut self, self_: Resource<IncomingResponse>, ) -> Result<Resource<Headers>>

Returns the headers from the incoming response.

The returned headers resource is immutable: set, append, and delete operations will fail with header-error.immutable.

This headers resource is a child: it must be dropped before the parent incoming-response is dropped.

Source

fn consume( &mut self, self_: Resource<IncomingResponse>, ) -> Result<Result<Resource<IncomingBody>, ()>>

Returns the incoming body. May be called at most once. Returns error if called additional times.

Source

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

Implementations on Foreign Types§

Source§

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

Source§

fn status(&mut self, self_: Resource<IncomingResponse>) -> Result<StatusCode>

Returns the status code from the incoming response.

Source§

fn headers( &mut self, self_: Resource<IncomingResponse>, ) -> Result<Resource<Headers>>

Returns the headers from the incoming response.

The returned headers resource is immutable: set, append, and delete operations will fail with header-error.immutable.

This headers resource is a child: it must be dropped before the parent incoming-response is dropped.

Source§

fn consume( &mut self, self_: Resource<IncomingResponse>, ) -> Result<Result<Resource<IncomingBody>, ()>>

Returns the incoming body. May be called at most once. Returns error if called additional times.

Source§

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

Implementors§