Struct fastly::handle::PendingRequestHandle
source · 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§
source§impl 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()
.
Trait Implementations§
source§impl Debug for PendingRequestHandle
impl Debug for PendingRequestHandle
source§impl From<PendingRequest> for PendingRequestHandle
impl From<PendingRequest> for PendingRequestHandle
source§fn from(pr: PendingRequest) -> Self
fn from(pr: PendingRequest) -> Self
source§impl Hash for PendingRequestHandle
impl Hash for PendingRequestHandle
source§impl PartialEq for PendingRequestHandle
impl PartialEq for PendingRequestHandle
source§fn eq(&self, other: &PendingRequestHandle) -> bool
fn eq(&self, other: &PendingRequestHandle) -> bool
self
and other
values to be equal, and is used
by ==
.