pub struct PostureWatch { /* private fields */ }Expand description
Watch-style subscription to the fleet posture feed — the workers-crate
equivalent of a tokio::sync::watch receiver (the crate carries no
tokio; this is the parking_lot pattern its other feeds use). One
producer (the PostureOwner), many independent consumers: every
FleetHost subscribes at boot for the T7 shed trigger, tests subscribe
to observe transitions, and the Part B operator channel will drive the
owner directly. A consumer sees the latest posture and REAL transitions
only — a Held tick or a no-effect retune never raises an edge.
Implementations§
Source§impl PostureWatch
impl PostureWatch
Sourcepub fn current(&self) -> FleetPosture
pub fn current(&self) -> FleetPosture
The latest posture (reads through — never consumes the edge).
Sourcepub fn has_changed(&self) -> bool
pub fn has_changed(&self) -> bool
Did a transition occur since the last drain? (Does not consume.)
Sourcepub fn take_if_changed(&self) -> Option<FleetPosture>
pub fn take_if_changed(&self) -> Option<FleetPosture>
Drain: the posture if a transition occurred since the last drain,
else None (consuming the edge — exactly-once per transition).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PostureWatch
impl !RefUnwindSafe for PostureWatch
impl !UnwindSafe for PostureWatch
impl Send for PostureWatch
impl Sync for PostureWatch
impl Unpin for PostureWatch
impl UnsafeUnpin for PostureWatch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more