pub struct Timer(pub u64);
Expand description
A timer.
Tuple Fields§
§0: u64
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn repeated(self, initial: Duration, period: Duration)
pub fn repeated(self, initial: Duration, period: Duration)
Programs the timer to fire repeatedly.
initial
is the period after which the timer expires for the first time.
Sourcepub fn cancel(self)
pub fn cancel(self)
Cancels the timer.
The timer remains valid but will never expire. It can be reprogrammed by calling
once
or repeated
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Timer
impl<'de> Deserialize<'de> for Timer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Timer
impl Eq for Timer
impl StructuralPartialEq for Timer
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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