pub struct TimerContext { /* private fields */ }Expand description
Delegated control capability scoped to one exact consumer-work attempt.
Identity remains inspectable after work returns, but mutation methods then
return TimerError::RegistrationExpired. Retain the policy-specific
registration capability for longer-lived ownership.
Implementations§
Source§impl TimerContext
impl TimerContext
Sourcepub const fn identity(&self) -> &TimerIdentity
pub const fn identity(&self) -> &TimerIdentity
Return the logical timer identity executing this work.
Sourcepub fn ensure_once(&self, schedule: TimerSchedule) -> Result<(), TimerError>
pub fn ensure_once(&self, schedule: TimerSchedule) -> Result<(), TimerError>
Schedule a Once declaration while this exact work attempt is active.
A context retained after its callback completes is expired and returns
TimerError::RegistrationExpired.
Sourcepub fn reconcile_schedule(
&self,
schedule: Option<TimerSchedule>,
) -> Result<(), TimerError>
pub fn reconcile_schedule( &self, schedule: Option<TimerSchedule>, ) -> Result<(), TimerError>
Reconcile the executing ordinary declaration to one exact schedule.
None cancels live work while retaining callback authority. Watchdog
declarations reject this operation. A retained context cannot mutate
the registration after its exact work attempt ends.
Sourcepub fn ensure_recurring(&self) -> Result<(), TimerError>
pub fn ensure_recurring(&self) -> Result<(), TimerError>
Ensure recurrence while this exact work attempt is active.
Sourcepub fn cancel(&self) -> Result<(), TimerError>
pub fn cancel(&self) -> Result<(), TimerError>
Request cancellation while this exact work attempt is active.