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
sourceimpl 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
.
Trait Implementations
sourceimpl From<PendingRequest> for PendingRequestHandle
impl From<PendingRequest> for PendingRequestHandle
sourcefn from(pr: PendingRequest) -> Self
fn from(pr: PendingRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for PendingRequest
impl Send for PendingRequest
impl Sync for PendingRequest
impl Unpin for PendingRequest
impl !UnwindSafe for PendingRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more