pub struct CancelledFuture { /* private fields */ }Expand description
A future that completes when a CancellationToken is cancelled.
- If the token is already cancelled, poll returns
Poll::Readyimmediately. - Otherwise, the future registers its waker and returns
Poll::Pending.
Single-threaded only. Not Send or Sync. The future will be woken exactly once when the token is cancelled.
Trait Implementations§
Source§impl Future for CancelledFuture
impl Future for CancelledFuture
Auto Trait Implementations§
impl Freeze for CancelledFuture
impl !RefUnwindSafe for CancelledFuture
impl !Send for CancelledFuture
impl !Sync for CancelledFuture
impl Unpin for CancelledFuture
impl !UnwindSafe for CancelledFuture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more