pub struct Timer<T, R = Milliseconds>where
R: Resolution,{ /* private fields */ }
Expand description
A timer that runs in a loop and expires tasks.
Implementations§
source§impl<T, R> Timer<T, R>where
R: Resolution,
T: Debug,
impl<T, R> Timer<T, R>where
R: Resolution,
T: Debug,
sourcepub fn new() -> (Self, UnboundedReceiver<T>)
pub fn new() -> (Self, UnboundedReceiver<T>)
Create a new timer.
sourcepub fn handle(&self) -> TimerHandle<T>
pub fn handle(&self) -> TimerHandle<T>
Get a handle to this timer.
Auto Trait Implementations§
impl<T, R> Freeze for Timer<T, R>
impl<T, R = Milliseconds> !RefUnwindSafe for Timer<T, R>
impl<T, R> Send for Timer<T, R>
impl<T, R> Sync for Timer<T, R>
impl<T, R> Unpin for Timer<T, R>
impl<T, R = Milliseconds> !UnwindSafe for Timer<T, R>
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