Skip to main content

WrapReport

Struct WrapReport 

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

Schema version of this wrap. Bump on shape changes so a future reader can refuse an incompatible blob up front.

§session_ulid: String

The 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: u64

Duration 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: u64

Total events the store captured this session. Includes every line that hit SessionSink::push.

§event_counts: EventCounts

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

Source§

fn clone(&self) -> WrapReport

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WrapReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WrapReport

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for WrapReport

Source§

fn eq(&self, other: &WrapReport) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for WrapReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for WrapReport

Source§

impl StructuralPartialEq for WrapReport

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,