#[non_exhaustive]pub enum StreamFrame {
Snapshot {
active_sessions: Vec<ActiveSession>,
reachability: Vec<PeerReachability>,
},
Event {
record: Box<AuditRecord>,
},
Reachability {
peer: PeerReachability,
},
Lagged {
dropped: u64,
},
}Expand description
One frame of the Request::Subscribe stream (pairing liveness & health telemetry). Tagged on
type (snake_case), so a frame is {"type":"snapshot",...} / {"type":"event",...} /
{"type":"lagged",...}. Event.record is the AuditRecord verbatim, so the stream and the
on-disk log carry ONE schema. The daemon serializes these; an embedding consumer deserializes
them (see docs/local-protocol.md “Live event stream”).
#[non_exhaustive]: a future frame kind must not break a downstream match. Adding
Reachability in 0.13.0 DID break exhaustive matches — which is why that release is a MINOR,
per RELEASING.md’s pre-1.0 rule that breaking changes bump the minor. Consumers now write a
_ => arm and later additions are additive for Rust as well as for JSON.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Snapshot
The FIRST frame: a point-in-time picture of the mesh (open sessions + paired-peer reachability) so a fresh subscriber renders immediately without replaying history.
Event
A live audit event (session open/close, request, blob fetch, trust) — the tap on the hub.
Boxed so this (much larger) variant does not bloat every frame; serde delegates through the
Box, so the wire shape is the record’s fields verbatim.
Fields
record: Box<AuditRecord>Reachability
A peer’s reachability TRANSITIONED (#58): it became reachable, became unreachable, or was
probed for the first time. Pushed so an embedder does not have to poll status for a live
online/offline indicator — and so work queued for an unreachable peer can flush the moment
it returns, rather than on the next poll tick.
Emitted on a CHANGE of reachable only. A refreshed probe with the same verdict emits
nothing, so a peer that stays up does not produce a frame per TTL refresh; rtt_ms/meta/
services drift is advisory detail and is not a transition. age_secs is 0 — the probe
just completed.
Fields
peer: PeerReachabilityLagged
The subscriber fell dropped records behind the broadcast ring; the stream continues (a
fresh reconnect would re-Snapshot). Never drops the subscriber — lag is reported, never fatal.
Trait Implementations§
Source§impl Clone for StreamFrame
impl Clone for StreamFrame
Source§fn clone(&self) -> StreamFrame
fn clone(&self) -> StreamFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more