pub struct PollingScheduler { /* private fields */ }Implementations§
Source§impl PollingScheduler
impl PollingScheduler
pub fn new() -> Self
pub fn register( &self, name: &str, interval: Duration, tick: impl Fn() + Send + Sync + 'static, )
pub fn set_foreground(&self, foreground: bool)
Sourcepub fn reset_cadence(&self)
pub fn reset_cadence(&self)
Clear every registration’s last-fired time so the loop fires each task on its next tick. Used on foreground transitions to refresh immediately instead of waiting out the remaining interval.
pub fn shutdown(&self)
Trait Implementations§
Source§impl Default for PollingScheduler
impl Default for PollingScheduler
Auto Trait Implementations§
impl !Freeze for PollingScheduler
impl RefUnwindSafe for PollingScheduler
impl Send for PollingScheduler
impl Sync for PollingScheduler
impl Unpin for PollingScheduler
impl UnwindSafe for PollingScheduler
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