Skip to main content

UiLiveness

Struct UiLiveness 

Source
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: u32

Phase 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

Source

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.

Source

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.

Source

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).

Source

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).

Source

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

Source§

fn default() -> UiLiveness

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more