Trait wasmcloud_runtime::capability::http::outgoing_handler::Host
source · pub trait Host: Send {
// Required method
fn handle(
&mut self,
request: Resource<HostOutgoingRequest>,
options: Option<Resource<HostRequestOptions>>,
) -> Result<Resource<HostFutureIncomingResponse>, HttpError>;
}
Required Methods§
sourcefn handle(
&mut self,
request: Resource<HostOutgoingRequest>,
options: Option<Resource<HostRequestOptions>>,
) -> Result<Resource<HostFutureIncomingResponse>, HttpError>
fn handle( &mut self, request: Resource<HostOutgoingRequest>, options: Option<Resource<HostRequestOptions>>, ) -> Result<Resource<HostFutureIncomingResponse>, HttpError>
This function is invoked with an outgoing HTTP Request, and it returns
a resource future-incoming-response
which represents an HTTP Response
which may arrive in the future.
The options
argument accepts optional parameters for the HTTP
protocol’s transport layer.
This function may return an error if the outgoing-request
is invalid
or not allowed to be made. Otherwise, protocol errors are reported
through the future-incoming-response
.
Implementations on Foreign Types§
source§impl<_T> Host for &mut _T
impl<_T> Host for &mut _T
source§fn handle(
&mut self,
request: Resource<HostOutgoingRequest>,
options: Option<Resource<HostRequestOptions>>,
) -> Result<Resource<HostFutureIncomingResponse>, HttpError>
fn handle( &mut self, request: Resource<HostOutgoingRequest>, options: Option<Resource<HostRequestOptions>>, ) -> Result<Resource<HostFutureIncomingResponse>, HttpError>
This function is invoked with an outgoing HTTP Request, and it returns
a resource future-incoming-response
which represents an HTTP Response
which may arrive in the future.
The options
argument accepts optional parameters for the HTTP
protocol’s transport layer.
This function may return an error if the outgoing-request
is invalid
or not allowed to be made. Otherwise, protocol errors are reported
through the future-incoming-response
.