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§