pub struct WrapReport {
pub schema: u32,
pub session_ulid: String,
pub started_at: DateTime<Utc>,
pub ended_at: DateTime<Utc>,
pub duration_secs: u64,
pub total_events: u64,
pub event_counts: EventCounts,
pub top_commands: Vec<CommandCount>,
}Expand description
The wrap artifact as persisted to disk and printed as a line in the log.
#[serde(deny_unknown_fields)] is intentional on the
reader side (not here) — a future wrap schema that drops
a field would be a silent honesty regression if old tooling
kept deserialising the old shape. For now the writer is the
only producer, so no deny-unknown on this struct.
Fields§
§schema: u32Schema version of this wrap. Bump on shape changes so a future reader can refuse an incompatible blob up front.
session_ulid: StringThe session’s ULID. Matches the artifact filename so reading a wraps directory without loading JSON is possible.
started_at: DateTime<Utc>Session start — ISO-8601 with zone.
ended_at: DateTime<Utc>Session end — the timestamp the wrap is being generated
at (the event-loop’s drive() returns and we snapshot
Utc::now()). Not the last-event timestamp because the
operator may have idled at the prompt for a while after
the last command and that idle is still session time.
duration_secs: u64Duration in seconds. Redundant with ended_at - started_at but materialised so a reader does not have
to do the subtraction and does not have to agree on
leap-second handling.
total_events: u64Total events the store captured this session. Includes
every line that hit SessionSink::push.
event_counts: EventCountsPer-kind event counts. Stable insertion order: prompt,
command, system, warn, alert, mode_change. A future
kind added to EventKind surfaces as a zero here
until the generator is updated (caught by the
exhaustive-match test).
top_commands: Vec<CommandCount>The top-N most-invoked slash commands this session.
Computed from prompt events whose text starts with
/. Ordered by descending count, then alphabetically
on ties for determinism. N = 10 is the hard cap so
a session that hammered /status does not bury the
rest.
Trait Implementations§
Source§impl Clone for WrapReport
impl Clone for WrapReport
Source§fn clone(&self) -> WrapReport
fn clone(&self) -> WrapReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WrapReport
impl Debug for WrapReport
Source§impl<'de> Deserialize<'de> for WrapReport
impl<'de> Deserialize<'de> for WrapReport
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>,
Source§impl PartialEq for WrapReport
impl PartialEq for WrapReport
Source§impl Serialize for WrapReport
impl Serialize for WrapReport
impl Eq for WrapReport
impl StructuralPartialEq for WrapReport
Auto Trait Implementations§
impl Freeze for WrapReport
impl RefUnwindSafe for WrapReport
impl Send for WrapReport
impl Sync for WrapReport
impl Unpin for WrapReport
impl UnsafeUnpin for WrapReport
impl UnwindSafe for WrapReport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.