Struct futures_delay_queue::DelayHandle
source · [−]pub struct DelayHandle { /* private fields */ }Expand description
A handle to cancel the corresponding delay of an item in DelayQueue.
Implementations
sourceimpl DelayHandle
impl DelayHandle
sourcepub async fn reset_at(self, when: Instant) -> Result<Self, ErrorAlreadyExpired>
pub async fn reset_at(self, when: Instant) -> Result<Self, ErrorAlreadyExpired>
Resets the delay of the corresponding item to when and returns a new DelayHandle on
success.
sourcepub async fn reset(self, dur: Duration) -> Result<Self, ErrorAlreadyExpired>
pub async fn reset(self, dur: Duration) -> Result<Self, ErrorAlreadyExpired>
Resets the delay of the corresponding item to now + dur and returns a new DelayHandleon
success.
sourcepub async fn cancel(self) -> Result<(), ErrorAlreadyExpired>
pub async fn cancel(self) -> Result<(), ErrorAlreadyExpired>
Cancels the delay.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DelayHandle
impl Send for DelayHandle
impl Sync for DelayHandle
impl Unpin for DelayHandle
impl !UnwindSafe for DelayHandle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more