pub struct TimerApi;Expand description
Public timer facade used by Canic’s macro-expanded entrypoints.
Implementations§
Source§impl TimerApi
impl TimerApi
Sourcepub fn set(
delay: Duration,
label: impl Into<String>,
task: impl Future<Output = ()> + 'static,
) -> TimerHandle
pub fn set( delay: Duration, label: impl Into<String>, task: impl Future<Output = ()> + 'static, ) -> TimerHandle
Schedule a cancellable application one-shot.
Sourcepub fn defer_lifecycle(
delay: Duration,
label: impl Into<String>,
task: impl Future<Output = ()> + 'static,
) -> TimerHandle
pub fn defer_lifecycle( delay: Duration, label: impl Into<String>, task: impl Future<Output = ()> + 'static, ) -> TimerHandle
Defer lifecycle work through the same one-shot authority.
Sourcepub fn set_interval<F, Fut>(
interval: Duration,
label: impl Into<String>,
task: F,
) -> TimerHandle
pub fn set_interval<F, Fut>( interval: Duration, label: impl Into<String>, task: F, ) -> TimerHandle
Schedule a cancellable, non-overlapping after-completion interval.
Sourcepub fn cancel(handle: TimerHandle) -> bool
pub fn cancel(handle: TimerHandle) -> bool
Consume a timer handle and suppress any future invocation.
Auto Trait Implementations§
impl Freeze for TimerApi
impl RefUnwindSafe for TimerApi
impl Send for TimerApi
impl Sync for TimerApi
impl Unpin for TimerApi
impl UnsafeUnpin for TimerApi
impl UnwindSafe for TimerApi
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