Skip to main content

Observable

Trait Observable 

Source
pub trait Observable {
    // Required method
    fn change_token(&self) -> u32;
}
Expand description

A type whose writes can be observed without interpreting the value.

change_token() returns a u32 whose only meaning is that two unequal readings prove the signal was written between them. It is allowed to wrap, and the supervisor never orders or interprets the numeric value.

For entries that feed a node’s heartbeat (observed beat), the token must be counting: each write must advance it, because the heartbeat machinery folds multiple beat entries into a single wrapping sum. Plain value-as-token works for ordinary observation but is unsuitable for beats.

Required Methods§

Source

fn change_token(&self) -> u32

Return a token that changes when the signal is written.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Observable for Atomic<bool>

Available on target_has_atomic=8 only.
Source§

impl Observable for Atomic<i8>

Available on target_has_atomic=8 only.
Source§

impl Observable for Atomic<i16>

Available on target_has_atomic=16 only.
Source§

impl Observable for Atomic<i32>

Available on target_has_atomic=32 only.
Source§

impl Observable for Atomic<i64>

Available on target_has_atomic=64 only.
Source§

impl Observable for Atomic<isize>

Available on target_has_atomic=ptr only.
Source§

impl Observable for Atomic<u8>

Available on target_has_atomic=8 only.
Source§

impl Observable for Atomic<u16>

Available on target_has_atomic=16 only.
Source§

impl Observable for Atomic<u32>

Available on target_has_atomic=32 only.
Source§

impl Observable for Atomic<u64>

Available on target_has_atomic=64 only.
Source§

impl Observable for Atomic<usize>

Available on target_has_atomic=ptr only.
Source§

impl Observable for AtomicBool

Source§

impl Observable for AtomicI8

Source§

impl Observable for AtomicI16

Source§

impl Observable for AtomicI32

Source§

impl Observable for AtomicI64

Source§

impl Observable for AtomicIsize

Source§

impl Observable for AtomicU8

Source§

impl Observable for AtomicU16

Source§

impl Observable for AtomicU32

Source§

impl Observable for AtomicU64

Source§

impl Observable for AtomicUsize

Implementors§

Source§

impl<T: Observable> Observable for Backed<T>

Available on crate feature coupling-observe only.
Source§

impl<T: Observable> Observable for Leased<T>

Available on crate feature coupling-observe only.

Polling a wrapped signal is polling what it wraps, so an observed entry keeps working when a signal gains a lease count.

Source§

impl<T: Observable> Observable for Stamped<T>

Available on crate feature coupling-observe only.
Source§

impl<T> Observable for Counted<T>

Source§

impl<const N: usize> Observable for VetoGate<N>

Available on crate feature coupling-observe only.