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§
source§impl 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 DelayHandle
on 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§
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