pub struct UiLiveness {
probe_sent: Option<(u64, Instant)>,
last_alive: Option<Instant>,
consecutive_misses: u32,
}Fields§
§probe_sent: Option<(u64, Instant)>Most recent probe: (nonce, when sent). One outstanding probe at a
time is enough at the Phase-1 rate; an unanswered probe is simply
overwritten by the next tick (the gap shows up as last_alive
growing stale, which is the exact signal Phase 2 consumes).
last_alive: Option<Instant>Last time ANY ReportUiThreadAlive arrived — proof the UI thread
pumped at that moment, regardless of nonce matching.
consecutive_misses: u32Phase 2 — consecutive DELIVERED-but-unanswered probes. Incremented
when a new probe overwrites an unanswered one; reset by any reply.
Retracted probes (send failed — transport evidence, not liveness
evidence) never reach the overwrite path, so they can’t inflate
this. Consumed by the armed teardown rule
(teardown_backstop::should_teardown).
Implementations§
Source§impl UiLiveness
impl UiLiveness
Sourcepub fn record_probe_sent(&mut self, nonce: u64) -> Option<(u64, Instant)>
pub fn record_probe_sent(&mut self, nonce: u64) -> Option<(u64, Instant)>
Record a probe about to be sent. Returns the previous probe’s
(nonce, sent) if it was never answered — the caller logs the miss.
Sourcepub fn retract_probe(&mut self, nonce: u64)
pub fn retract_probe(&mut self, nonce: u64)
Retract an outstanding probe whose SEND failed (reagent P1: a transport failure must never age into a false “UI thread did not pump” report — the probe was never delivered, so its silence is transport evidence, not liveness evidence). No-op if a different probe is outstanding.
Sourcepub fn record_alive(&mut self, nonce: u64) -> Option<Duration>
pub fn record_alive(&mut self, nonce: u64) -> Option<Duration>
Record a ReportUiThreadAlive. Returns the round-trip latency when
the nonce matches the outstanding probe (None for a late/unmatched
reply — still recorded as aliveness, since ANY reply proves the UI
thread pumped after its probe was sent).
Sourcepub fn last_alive(&self) -> Option<Instant>
pub fn last_alive(&self) -> Option<Instant>
Phase-2 consumer surface: when did the host’s UI thread last prove
itself alive? None = never (host hasn’t answered a single probe
yet — startup, or standalone mode with no pipe).
Sourcepub fn consecutive_misses(&self) -> u32
pub fn consecutive_misses(&self) -> u32
Phase-2 consumer surface: consecutive delivered-but-unanswered probes. See the field doc for what does (and doesn’t) count.
Trait Implementations§
Source§impl Default for UiLiveness
impl Default for UiLiveness
Source§fn default() -> UiLiveness
fn default() -> UiLiveness
Auto Trait Implementations§
impl Freeze for UiLiveness
impl RefUnwindSafe for UiLiveness
impl Send for UiLiveness
impl Sync for UiLiveness
impl Unpin for UiLiveness
impl UnsafeUnpin for UiLiveness
impl UnwindSafe for UiLiveness
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.