Struct wasi::http::types::FutureTrailers
source · pub struct FutureTrailers { /* private fields */ }
Expand description
Represents a future which may eventaully return trailers, or an error.
In the case that the incoming HTTP Request or Response did not have any trailers, this future will resolve to the empty set of trailers once the complete Request or Response body has been received.
Implementations§
source§impl FutureTrailers
impl FutureTrailers
sourcepub fn get(&self) -> Option<Result<Result<Option<Trailers>, ErrorCode>, ()>>
pub fn get(&self) -> Option<Result<Result<Option<Trailers>, ErrorCode>, ()>>
Returns the contents of the trailers, or an error which occured, once the future 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 trailers 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 HTTP Request or Response
body, as well as any trailers, were received successfully, or that an
error occured receiving them. The optional trailers
indicates whether
or not trailers were present in the body.
When some trailers
are returned by this method, the trailers
resource is immutable, and a child. Use of the set
, append
, or
delete
methods will return an error, and the resource must be
dropped before the parent future-trailers
is dropped.