Struct wasmcloud_component::wasi::http::types::FutureIncomingResponse
source · pub struct FutureIncomingResponse { /* private fields */ }Expand description
Represents a future which may eventaully return an incoming HTTP Response, or an error.
This resource is returned by the wasi:http/outgoing-handler interface to
provide the HTTP Response corresponding to the sent Request.
Implementations§
source§impl FutureIncomingResponse
impl FutureIncomingResponse
sourcepub fn get(&self) -> Option<Result<Result<IncomingResponse, ErrorCode>, ()>>
pub fn get(&self) -> Option<Result<Result<IncomingResponse, ErrorCode>, ()>>
Returns the incoming HTTP Response, or an error, once one is ready.
The outer option represents future readiness. Users can wait on this
option to become some using the subscribe method.
The outer result is used to retrieve the response or error at most
once. It will be success on the first call in which the outer option
is some, and error on subsequent calls.
The inner result represents that either the incoming HTTP Response
status and headers have recieved successfully, or that an error
occured. Errors may also occur while consuming the response body,
but those will be reported by the incoming-body and its
output-stream child.