Trait wasmtime_wasi_http::bindings::http::types::HostResponseOutparam
source · pub trait HostResponseOutparam {
// Required methods
fn set(
&mut self,
param: Resource<ResponseOutparam>,
response: Result<Resource<OutgoingResponse>, ErrorCode>,
) -> Result<()>;
fn drop(&mut self, rep: Resource<ResponseOutparam>) -> Result<()>;
}
Required Methods§
sourcefn set(
&mut self,
param: Resource<ResponseOutparam>,
response: Result<Resource<OutgoingResponse>, ErrorCode>,
) -> Result<()>
fn set( &mut self, param: Resource<ResponseOutparam>, response: Result<Resource<OutgoingResponse>, ErrorCode>, ) -> Result<()>
Set the value of the response-outparam
to either send a response,
or indicate an error.
This method consumes the response-outparam
to ensure that it is
called at most once. If it is never called, the implementation
will respond with an error.
The user may provide an error
to response
to allow the
implementation determine how to respond with an HTTP error response.
fn drop(&mut self, rep: Resource<ResponseOutparam>) -> Result<()>
Implementations on Foreign Types§
source§impl<_T: HostResponseOutparam + ?Sized + Send> HostResponseOutparam for &mut _T
impl<_T: HostResponseOutparam + ?Sized + Send> HostResponseOutparam for &mut _T
source§fn set(
&mut self,
param: Resource<ResponseOutparam>,
response: Result<Resource<OutgoingResponse>, ErrorCode>,
) -> Result<()>
fn set( &mut self, param: Resource<ResponseOutparam>, response: Result<Resource<OutgoingResponse>, ErrorCode>, ) -> Result<()>
Set the value of the response-outparam
to either send a response,
or indicate an error.
This method consumes the response-outparam
to ensure that it is
called at most once. If it is never called, the implementation
will respond with an error.
The user may provide an error
to response
to allow the
implementation determine how to respond with an HTTP error response.