#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringFull UUID string.
short_id: String6-hex-char short id.
started_at: i64Unix-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: SessionStatusSession status.
agent_kind: AgentKindAgent kind.
adapter_status: AdapterStatusAdapter status.
command: Vec<String>Full command line.
cwd: PathBufWorking directory.
step_count: i64Count of steps (semantic events) in the session.
files_changed: i64Count 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
impl Clone for SessionRow
Source§fn clone(&self) -> SessionRow
fn clone(&self) -> SessionRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionRow
impl Debug for SessionRow
Source§impl Default for SessionRow
impl Default for SessionRow
Source§fn default() -> Self
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.