Skip to main content

OnceRegistration

Struct OnceRegistration 

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

Opaque non-clone claim for one registered Once callback.

Implementations§

Source§

impl OnceRegistration

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 provider wake-up.

This is a volatile observation, not durable scheduling authority or a delivery guarantee. Call Self::ensure_scheduled unconditionally when a wake-up is required rather than using this value as a scheduling guard.

Source

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

Ensure one invocation is armed or retained as the running work’s successor.

Source

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

Reconcile to one exact desired schedule, replacing a later or earlier live deadline as necessary.

During running work, a winning exact schedule replaces the callback scheduling proposal before validation; explicit invariant failure stops.

None leaves a retained declaration inactive after any running work completes or is abandoned. A remove-on-stop declaration is removed and this claim expires when the transition finalizes.

Source

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

Cancel the armed callback or the running work’s successor. Cancellation allocates no callback generation, even at the counter limit.

Consumer work already running is not interrupted. 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 or its confirmed delivery is abandoned.

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.