Struct fastly::http::request::PendingRequest
source · pub struct PendingRequest { /* private fields */ }
Expand description
A handle to a pending asynchronous request returned by Request::send_async()
or
Request::send_async_streaming()
.
A handle can be evaluated using PendingRequest::poll()
, PendingRequest::wait()
, or
select
. It can also be discarded if the request was sent for effects it might have, and the
response is unimportant.
Implementations§
source§impl PendingRequest
impl PendingRequest
sourcepub fn poll(self) -> PollResult
pub fn poll(self) -> PollResult
Try to get the result of a pending request without blocking.
This function returns immediately with a PollResult
; if you want to block until a result
is ready, use PendingRequest::wait()
.
Panics
Panics if the backend response exceeds any of the limits configured by
ResponseLimits
.
sourcepub fn wait(self) -> Result<Response, SendError>
pub fn wait(self) -> Result<Response, SendError>
Block until the result of a pending request is ready.
If you want check whether the result is ready without blocking, use
PendingRequest::poll()
.
Panics
Panics if the backend response exceeds any of the limits configured by
ResponseLimits
.