pub struct AtomicTimer { /* private fields */ }Expand description
Atomic timer
Implementations§
Source§impl AtomicTimer
impl AtomicTimer
Sourcepub fn new(duration: Duration) -> Self
pub fn new(duration: Duration) -> Self
Create a new atomic timer
§Panics
Panics if the duration is too large (in nanos greater than i64::MAX)
Sourcepub fn expire_now(&self)
pub fn expire_now(&self)
Focibly expire the timer
Sourcepub fn reset_if_expired(&self) -> bool
pub fn reset_if_expired(&self) -> bool
Reset the timer if it has expired, return true if reset
Auto Trait Implementations§
impl !Freeze for AtomicTimer
impl RefUnwindSafe for AtomicTimer
impl Send for AtomicTimer
impl Sync for AtomicTimer
impl Unpin for AtomicTimer
impl UnwindSafe for AtomicTimer
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