pub struct TimerBuilder { /* private fields */ }Expand description
Builds and starts a timer with less boilerplate.
Implementations§
Source§impl TimerBuilder
impl TimerBuilder
Sourcepub fn expiration_count(self, expiration_count: usize) -> Self
pub fn expiration_count(self, expiration_count: usize) -> Self
Sets the expiration count for a recurring timer.
Sourcepub fn paused_start(self) -> Self
pub fn paused_start(self) -> Self
Starts the timer in the paused state.
Sourcepub fn with_events_disabled(self) -> Self
pub fn with_events_disabled(self) -> Self
Disables broadcast event emission for the timer.
Sourcepub async fn start<F>(self, callback: F) -> Result<Timer, TimerError>where
F: TimerCallback + 'static,
pub async fn start<F>(self, callback: F) -> Result<Timer, TimerError>where
F: TimerCallback + 'static,
Starts the configured timer and returns the handle.
Auto Trait Implementations§
impl Freeze for TimerBuilder
impl RefUnwindSafe for TimerBuilder
impl Send for TimerBuilder
impl Sync for TimerBuilder
impl Unpin for TimerBuilder
impl UnsafeUnpin for TimerBuilder
impl UnwindSafe for TimerBuilder
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