Skip to main content

WatchdogContext

Struct WatchdogContext 

Source
pub struct WatchdogContext { /* private fields */ }
Expand description

Delegated control capability scoped to one exact watchdog work attempt.

Mutation authority expires when the callback completes. Retain the WatchdogRegistration for longer-lived ownership.

Implementations§

Source§

impl WatchdogContext

Source

pub const fn identity(&self) -> &TimerIdentity

Return the logical timer identity executing this work.

Source

pub fn ensure_scheduled(&self) -> Result<(), TimerError>

Request that the pre-armed cadence successor remain scheduled.

This is idempotent unless it supersedes a nested cancellation request. It never arms an additional Watchdog successor and cannot move a pending immediate successor later.

Source

pub fn ensure_scheduled_immediately(&self) -> Result<(), TimerError>

Request that this work attempt’s pre-armed successor run immediately.

Repeated requests coalesce, and a cadence ensure cannot move the pending immediate deadline later. Normal completion replaces the exact cadence successor with a zero-delay scheduler callback. Consumer work still runs only in the scheduler’s separately queued later message.

Source

pub fn reconcile_schedule( &self, schedule: Option<TimerSchedule>, ) -> Result<(), TimerError>

Replace this attempt’s successor with an exact schedule, or cancel it.

Applied on normal completion; a trap preserves the committed cadence successor. The latest reconciliation wins over prior scheduling demand, but unregistration and invariant failure remain terminal.

Source

pub fn cancel(&self) -> Result<(), TimerError>

Request cancellation while this exact work attempt is active.

Cancellation does not interrupt the current invocation; normal completion clears the already-armed successor when cancellation wins. A retained declaration becomes inactive; a remove-on-stop declaration is removed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.