pub struct TimerId(pub u64);Expand description
Names one registered timer.
Opaque, and the same type for every protocol, so a timer’s identity says nothing about which layer registered it or where that layer sits in a composition. The alternative — a timer type per protocol, re-wrapped by each parent — makes the type encode the composition path, so inserting a layer rewraps every timer beneath it and a layer’s timer vocabulary becomes visible to everything above it.
Holding one also lets a layer recognise an expiry it has superseded, and would let one be
cancelled. A bool can express neither.
Tuple Fields§
§0: u64Trait Implementations§
impl Copy for TimerId
impl Eq for TimerId
Source§impl Ord for TimerId
impl Ord for TimerId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for TimerId
impl PartialOrd for TimerId
impl StructuralPartialEq for TimerId
Auto Trait Implementations§
impl Freeze for TimerId
impl RefUnwindSafe for TimerId
impl Send for TimerId
impl Sync for TimerId
impl Unpin for TimerId
impl UnsafeUnpin for TimerId
impl UnwindSafe for TimerId
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