pub struct Timer { /* private fields */ }
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn schedule<F>(&self, delay: Duration, f: F)
pub fn schedule<F>(&self, delay: Duration, f: F)
Schedule a function that will be called once after ‘delay’
execution order of functions scheduled at a a same delay is not guaranteed
§Warning
Timer callbacks should be executed as switfly as possible, if you need to block inside the callback, hand it over to another thread
§Panics
The schedule
function will panic if delay is no bigger than Duration::ZERO.
Trait Implementations§
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