Struct fastly::handle::PendingRequestHandle
source · [−]#[repr(transparent)]pub struct PendingRequestHandle { /* private fields */ }
Expand description
A handle to a pending asynchronous request returned by
RequestHandle::send_async()
or
RequestHandle::send_async_streaming()
.
A handle can be evaluated using PendingRequestHandle::poll()
,
PendingRequestHandle::wait()
, or select_handles()
. It
can also be discarded if the request was sent for effects it might have, and the response is
unimportant.
Implementations
sourceimpl PendingRequestHandle
impl PendingRequestHandle
sourcepub fn as_u32(&self) -> u32
pub fn as_u32(&self) -> u32
Get the underlying representation of the handle.
This should only be used when calling the raw ABI directly, and care should be taken not to reuse or alias handle values.
sourcepub fn poll(self) -> PollHandleResult
pub fn poll(self) -> PollHandleResult
Try to get the result of a pending request without blocking.
This function returns immediately with a PollHandleResult
; if you want to block until a
result is ready, use wait()
.
sourcepub fn wait(self) -> Result<(ResponseHandle, BodyHandle), SendErrorCause>
pub fn wait(self) -> Result<(ResponseHandle, BodyHandle), SendErrorCause>
Block until the result of a pending request is ready.
If you want check whether the result is ready without blocking, use
poll()
.