pub struct AeronStatusTracker { /* private fields */ }Expand description
Status transition tracker that emits only when the observed AeronStatus
differs from the previously recorded state.
Mirrors the reactive side-channel pattern in wingfoil’s AeronStatusStream,
useful for driving application-level state machines (e.g. reconnect logic,
UI indicators) that need to react to connection changes without polling.
§Example
ⓘ
// (illustrative — `publication.status()` needs a live handle; see the
// `aeron_custom_tests` unit tests for runnable pure-Rust assertions)
let mut tracker = AeronStatusTracker::new();
tracker.observe(publication.status()); // emits `Some(Disconnected)`
// ... connection establishes ...
tracker.observe(publication.status()); // emits `Some(Connected)`
tracker.observe(publication.status()); // emits `None` (no change)Implementations§
Source§impl AeronStatusTracker
impl AeronStatusTracker
Sourcepub fn observe(&mut self, status: AeronStatus) -> Option<AeronStatus>
pub fn observe(&mut self, status: AeronStatus) -> Option<AeronStatus>
Observe a status, returning Some(status) if this is a transition from
the previous state (or the first observation), None if the status is
unchanged.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the tracker, causing the next call to observe
to emit even if the status matches the previously-observed value.
Sourcepub const fn last_status(&self) -> Option<AeronStatus>
pub const fn last_status(&self) -> Option<AeronStatus>
The most recent status observed, if any.
Trait Implementations§
Source§impl Clone for AeronStatusTracker
impl Clone for AeronStatusTracker
Source§fn clone(&self) -> AeronStatusTracker
fn clone(&self) -> AeronStatusTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AeronStatusTracker
impl Debug for AeronStatusTracker
Source§impl Default for AeronStatusTracker
impl Default for AeronStatusTracker
Source§impl PartialEq for AeronStatusTracker
impl PartialEq for AeronStatusTracker
impl Copy for AeronStatusTracker
impl Eq for AeronStatusTracker
impl StructuralPartialEq for AeronStatusTracker
Auto Trait Implementations§
impl Freeze for AeronStatusTracker
impl RefUnwindSafe for AeronStatusTracker
impl Send for AeronStatusTracker
impl Sync for AeronStatusTracker
impl Unpin for AeronStatusTracker
impl UnsafeUnpin for AeronStatusTracker
impl UnwindSafe for AeronStatusTracker
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