pub struct Timer { /* private fields */ }
Implementations§
Source§impl Timer
impl Timer
pub fn new(timer_type: TimerType, duration: &Duration) -> Arc<Mutex<Timer>>
pub fn start(timer: &Arc<Mutex<Timer>>)
pub fn stop(&mut self)
pub fn pause(&mut self)
pub fn time_left(&self) -> Duration
pub fn on( &mut self, event: TimerEvent, callback: Arc<dyn Fn(&Timer) + Send + Sync>, )
pub fn timer_type(&self) -> TimerType
pub fn clone(&self) -> 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