pub struct Timer<'h> { /* private fields */ }
Expand description
Represents an instance of scheduled timer for a specific task.
Timer
instance owns1 the space for the task’s closure. So when the timer is out of scope, it is forced to stop and
destroy the closure during Drop
processing.
However,
TimerQueue::fire_onshot
does not createTimer
instance. That’s why the function need a'static
closure lifetime. ↩
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'h> Freeze for Timer<'h>
impl<'h> !RefUnwindSafe for Timer<'h>
impl<'h> !Send for Timer<'h>
impl<'h> !Sync for Timer<'h>
impl<'h> Unpin for Timer<'h>
impl<'h> !UnwindSafe for Timer<'h>
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