pub struct CancelTimer(/* private fields */);Expand description
Implementation of CancellationTrigger that is canceled once the specified Duration
elapsed. The “timer” is started immediately upon creation.
See also on_timeout.
§Logging
[trace]Every time a timer is started or elapsed (i.e., upon cancellation).[warn]If the timer is dropped, but the timer thread cannot be safely destroyed.
Implementations§
Source§impl CancelTimer
impl CancelTimer
Sourcepub fn start(duration: Duration) -> Self
pub fn start(duration: Duration) -> Self
Create a new CancelTimer that will be canceled once the given duration elapsed.
Trait Implementations§
Source§impl CancellationTrigger for CancelTimer
impl CancellationTrigger for CancelTimer
Source§fn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
Returns true if this trigger is canceled. Read more
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Return the type name of this
CancellationTrigger, or in case of “composite”
triggers, the type name of the trigger that actually signaled the cancellation.Source§impl Clone for CancelTimer
impl Clone for CancelTimer
Source§fn clone(&self) -> CancelTimer
fn clone(&self) -> CancelTimer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CancelTimer
impl !RefUnwindSafe for CancelTimer
impl Send for CancelTimer
impl Sync for CancelTimer
impl Unpin for CancelTimer
impl !UnwindSafe for CancelTimer
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