pub struct TimerManager { /* private fields */ }
Available on crate feature
time
only.Expand description
The object that holds all the timers registered to it.
Implementations§
Source§impl TimerManager
impl TimerManager
Sourcepub fn new() -> TimerManager
pub fn new() -> TimerManager
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§
Source§impl Default for TimerManager
impl Default for TimerManager
Source§fn default() -> TimerManager
fn default() -> TimerManager
Returns the “default value” for a type. Read more
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