Trait wasmtime_wasi_http::bindings::http::types::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§
sourcefn status(&mut self, self_: Resource<IncomingResponse>) -> Result<StatusCode>
fn status(&mut self, self_: Resource<IncomingResponse>) -> Result<StatusCode>
Returns the status code from the incoming response.
sourcefn headers(
&mut self,
self_: Resource<IncomingResponse>,
) -> Result<Resource<Headers>>
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.
sourcefn consume(
&mut self,
self_: Resource<IncomingResponse>,
) -> Result<Result<Resource<IncomingBody>, ()>>
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.
fn drop(&mut self, rep: Resource<IncomingResponse>) -> Result<()>
Implementations on Foreign Types§
source§impl<_T: HostIncomingResponse + ?Sized + Send> HostIncomingResponse for &mut _T
impl<_T: HostIncomingResponse + ?Sized + Send> HostIncomingResponse for &mut _T
source§fn status(&mut self, self_: Resource<IncomingResponse>) -> Result<StatusCode>
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>>
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>, ()>>
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.