Skip to main content

WatchdogRegistration

Struct WatchdogRegistration 

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

Opaque non-clone claim for one pre-armed watchdog callback.

Implementations§

Source§

impl WatchdogRegistration

Source

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

Return the claimed logical identity.

Source

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

Return whether this exact claim currently owns an armed scheduler wake-up.

The separately queued work callback is not itself a wake-up. During watchdog work this returns true only because the scheduler has already committed and installed the cadence successor. This is a volatile observation, not a delivery guarantee.

Source

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

Synchronously ensure one watchdog scheduler wake-up is authoritative.

An existing earlier immediate deadline is retained and never delayed.

Source

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

Synchronously ensure one watchdog scheduler wake-up is due now.

An inactive declaration arms one zero-delay scheduler. A later cadence deadline is replaced in place; an already earlier or equivalent deadline and repeated immediate requests coalesce. If work is already dispatched, that zero-delay work satisfies the request. If work is running, the request applies to that attempt’s pre-armed successor.

Source

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

Reconcile to one exact scheduler deadline, or cancel with None.

Unlike ensure, this can move a wake-up later. Identical deadlines coalesce. Dispatched or running work is not postponed: reconciliation selects its successor on normal completion. Until then, the committed cadence successor remains the recovery wake-up. A subsequent recovery attempt retires the interrupted attempt’s pending proposal.

Source

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

Cancel the scheduler and any work callback that has not started.

Consumer work already running is not interrupted; normal completion clears its pre-armed successor. A retained declaration keeps callback authority. A remove-on-stop declaration and this claim expire when cancellation finalizes.

Source

pub fn unregister(self) -> Result<(), TimerError>

Consume the claim and unregister its callback authority.

When called from running work, removal is deferred until that invocation completes normally.

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.