pub struct TimerManager { /* private fields */ }
Expand description
The object that holds all the timers registered to it.
Implementations§
Source§impl TimerManager
impl TimerManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new TimerManager
Sourcepub fn register_timer(&self, duration: Duration) -> TimerStub
pub fn register_timer(&self, duration: Duration) -> TimerStub
Register a timer.
When the timer expires, the TimerStub will be notified.
Sourcepub fn pause_for_fork(&self)
pub fn pause_for_fork(&self)
Pause the timer for fork()
Because RwLock across fork() is undefined behavior, this function makes sure that no one holds any locks.
This function should be called right before fork().
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TimerManager
impl RefUnwindSafe for TimerManager
impl Send for TimerManager
impl Sync for TimerManager
impl Unpin for TimerManager
impl UnwindSafe for TimerManager
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