pub struct AppTruth { /* private fields */ }Expand description
The process’s current-truth recorder: every lifecycle transition and announced fact since boot, retained for the life of the process (no cap — see the module docs for the bound this deliberately is NOT).
Implementations§
Source§impl AppTruth
impl AppTruth
Sourcepub fn empty() -> Arc<Self>
pub fn empty() -> Arc<Self>
An empty truth with no attached recorder thread. Used internally by
Self::spawn and, publicly, by fixtures/tests that construct a
crate::server::ShellConfig/crate::server::ShellServer without
a live component registry to record from (pure HTTP-serving tests).
Sourcepub fn spawn(
registry: &ComponentRegistry,
expected: HashSet<ComponentId>,
) -> Result<(Arc<Self>, JoinHandle<()>), HostError>
pub fn spawn( registry: &ComponentRegistry, expected: HashSet<ComponentId>, ) -> Result<(Arc<Self>, JoinHandle<()>), HostError>
Spawns the dedicated recorder thread on its OWN lifecycle
subscription, taken here — BEFORE component install, the same
convention the console logger and the announcer both follow — so the
boot transitions (Registered → Starting → Running) are never missed.
Recording runs independent of whether [frame].channel/the announcer
exists: this is host-local truth served over plain HTTP, not a bus
publish.
The recorder thread’s exit condition mirrors the console logger’s
exactly: it exits once it has observed the Removed transition of
every component in expected (published by ordered shutdown), or on
stream closure.
§Errors
Returns a typed failure for a poisoned subscribe or a thread spawn refusal.
Sourcepub fn record_fact(&self, body: Value)
pub fn record_fact(&self, body: Value)
Records one accepted application fact. Called by
crate::announcer::Announcer::announce_fact the moment a fact is
accepted — before the pump goes live.
Sourcepub fn snapshot(&self) -> AppTruthSnapshot
pub fn snapshot(&self) -> AppTruthSnapshot
Assembles the current snapshot: every transition and fact recorded so far, in order, plus each component’s latest observed state.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AppTruth
impl RefUnwindSafe for AppTruth
impl Send for AppTruth
impl Sync for AppTruth
impl Unpin for AppTruth
impl UnsafeUnpin for AppTruth
impl UnwindSafe for AppTruth
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request