Skip to main content

SessionRow

Struct SessionRow 

Source
#[non_exhaustive]
pub struct SessionRow {
Show 13 fields pub id: String, pub short_id: String, pub started_at: i64, pub ended_at: Option<i64>, pub exit_code: Option<i32>, pub status: SessionStatus, pub agent_kind: AgentKind, pub adapter_status: AdapterStatus, pub command: Vec<String>, pub cwd: PathBuf, pub step_count: i64, pub files_changed: i64, pub imported_from: Option<String>,
}
Expand description

A session row as read back from the DB.

#[non_exhaustive]: this is a growth-prone read model (this PR adds imported_from; more fields — hostname/model/git_*, none of which SessionRow exposes today — are a plausible future addition). Marking it non-exhaustive now means a future added field stays additive under cargo-semver-checks --release-type minor instead of registering as a break, matching the precedent set for Config/the error enums. External construction goes through Default + functional-record-update (SessionRow { field: value, ..SessionRow::default() }), which — unlike a struct literal naming every field — stays valid across a #[non_exhaustive] boundary; hh’s own test fixtures use this pattern.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: String

Full UUID string.

§short_id: String

6-hex-char short id.

§started_at: i64

Unix-ms UTC start timestamp.

§ended_at: Option<i64>

Unix-ms UTC end timestamp, if finalized.

§exit_code: Option<i32>

Process exit code, if finalized.

§status: SessionStatus

Session status.

§agent_kind: AgentKind

Agent kind.

§adapter_status: AdapterStatus

Adapter status.

§command: Vec<String>

Full command line.

§cwd: PathBuf

Working directory.

§step_count: i64

Count of steps (semantic events) in the session.

§files_changed: i64

Count of distinct file paths changed.

§imported_from: Option<String>

The original session id this session was imported from (hh import), or None for a locally-recorded session (SRS v1.0.0 addendum: additive column, migration 0003).

Trait Implementations§

Source§

impl Clone for SessionRow

Source§

fn clone(&self) -> SessionRow

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionRow

Source§

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

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

impl Default for SessionRow

Source§

fn default() -> Self

Neutral placeholder values — the sanctioned way to build a #[non_exhaustive] SessionRow from outside this crate is SessionRow { field: value, ..SessionRow::default() }, not a full struct literal. Real rows always come from crate::store::Store queries; this exists for that FRU pattern (test fixtures today, any future caller tomorrow), not for direct use.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.