pub struct Snapshot {
pub label: Label,
pub friction: FrictionLevel,
pub vector: StateVector,
pub as_of: DateTime<Utc>,
pub version: u64,
}Expand description
Cheap, clone-safe summary consumed by the TUI.
Fields§
§label: Label§friction: FrictionLevel§vector: StateVector§as_of: DateTime<Utc>When this snapshot was produced.
version: u64Monotonic version number; widgets compare to their last seen and skip render when equal.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn new(
label: Label,
vector: StateVector,
as_of: DateTime<Utc>,
version: u64,
) -> Self
pub fn new( label: Label, vector: StateVector, as_of: DateTime<Utc>, version: u64, ) -> Self
Construct a snapshot whose friction is derived from
label alone. Caps at L2 — call
Snapshot::new_with_risk from a caller with engine
access to reach L3/L4.
Sourcepub fn new_with_risk(
label: Label,
vector: StateVector,
as_of: DateTime<Utc>,
version: u64,
risk: RiskContext,
) -> Self
pub fn new_with_risk( label: Label, vector: StateVector, as_of: DateTime<Utc>, version: u64, risk: RiskContext, ) -> Self
Construct a snapshot whose friction is derived from both
label and the engine-reported risk.
This is the M2 entrypoint. It uses
FrictionLevel::from_label_and_risk so the snapshot’s
.friction field can reach L3 (TILT + guardrail proximity)
or L4 (TILT + halt). Callers without engine context (tests,
pure replay, the classifier’s default classify path) stay
on Self::new and retain the L2 cap.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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