pub struct SessionState {
pub info: SessionInfo,
pub finished_at: Option<OffsetDateTime>,
pub exit_code: Option<i32>,
pub duration_ms: Option<i64>,
pub summary: SummaryCounts,
pub logs: VecDeque<LogEntry>,
pub diagnostics: Vec<DiagnosticRecord>,
pub artifacts: Vec<ArtifactRecord>,
pub last_updated_at: OffsetDateTime,
/* private fields */
}Expand description
Session payload used by the TUI and persistence.
Fields§
§info: SessionInfoStable metadata.
finished_at: Option<OffsetDateTime>Latest completion time.
exit_code: Option<i32>Exit code if known.
duration_ms: Option<i64>Duration in milliseconds if known.
summary: SummaryCountsAggregated summary counts.
logs: VecDeque<LogEntry>Bounded raw/rendered logs.
diagnostics: Vec<DiagnosticRecord>Structured diagnostics.
artifacts: Vec<ArtifactRecord>Recorded artifacts.
last_updated_at: OffsetDateTimeLast update observed.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub fn new(info: SessionInfo, max_logs: usize) -> Self
pub fn new(info: SessionInfo, max_logs: usize) -> Self
Create a new state container from session metadata.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Return whether the session is currently active.
Sourcepub fn command_line(&self) -> String
pub fn command_line(&self) -> String
Return the best display command.
Sourcepub fn workspace_label(&self) -> String
pub fn workspace_label(&self) -> String
Return a short workspace label.
Sourcepub fn history_entry(&self) -> SessionHistoryEntry
pub fn history_entry(&self) -> SessionHistoryEntry
Build a history entry from the current state.
Sourcepub fn apply(&mut self, event: &SessionEvent)
pub fn apply(&mut self, event: &SessionEvent)
Apply an incoming event to the state.
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionState
impl Debug for SessionState
Source§impl<'de> Deserialize<'de> for SessionState
impl<'de> Deserialize<'de> for SessionState
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
Source§impl PartialEq for SessionState
impl PartialEq for SessionState
Source§impl Serialize for SessionState
impl Serialize for SessionState
impl Eq for SessionState
impl StructuralPartialEq for SessionState
Auto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnsafeUnpin for SessionState
impl UnwindSafe for SessionState
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