Skip to main content

SessionView

Struct SessionView 

Source
pub struct SessionView {
Show 31 fields pub id: SessionId, pub id_short: String, pub agent_type: String, pub model: String, pub status: SessionStatus, pub status_label: String, pub activity_detail: Option<String>, pub should_blink: bool, pub status_icon: String, pub context_percentage: f64, pub context_display: String, pub context_warning: bool, pub context_critical: bool, pub cost_display: String, pub cost_usd: f64, pub duration_display: String, pub duration_seconds: f64, pub lines_display: String, pub working_directory: Option<String>, pub needs_attention: bool, pub last_activity_display: String, pub age_display: String, pub started_at: String, pub last_activity: String, pub tmux_pane: Option<String>, pub project_root: Option<String>, pub worktree_path: Option<String>, pub worktree_branch: Option<String>, pub parent_session_id: Option<SessionId>, pub child_session_ids: Vec<SessionId>, pub first_prompt: Option<String>,
}
Expand description

Read-only view of a session for TUI display.

Immutable snapshot created from SessionDomain. Implements Clone for easy distribution to multiple UI components.

Fields§

§id: SessionId

Session identifier

§id_short: String

Short ID for display (first 8 chars)

§agent_type: String

Agent type label

§model: String

Model display name

§status: SessionStatus

Current status (3-state model)

§status_label: String

Status label for display

§activity_detail: Option<String>

Activity detail (tool name or context)

§should_blink: bool

Whether this status should blink

§status_icon: String

Status icon

§context_percentage: f64

Context usage percentage

§context_display: String

Context usage formatted string

§context_warning: bool

Whether context is in warning state

§context_critical: bool

Whether context is in critical state

§cost_display: String

Cost formatted string

§cost_usd: f64

Cost in USD (for sorting)

§duration_display: String

Duration formatted string

§duration_seconds: f64

Duration in seconds (for sorting)

§lines_display: String

Lines changed formatted string

§working_directory: Option<String>

Working directory (shortened for display)

§needs_attention: bool

Whether session needs attention (permission wait, high context)

§last_activity_display: String

Time since last activity (formatted)

§age_display: String

Session age (formatted)

§started_at: String

Session start time (ISO 8601)

§last_activity: String

Last activity time (ISO 8601)

§tmux_pane: Option<String>

Tmux pane ID (e.g., “%5”) if session is running in tmux

§project_root: Option<String>

Git project root (for grouping in tree view)

§worktree_path: Option<String>

Git worktree path

§worktree_branch: Option<String>

Git branch name for this worktree

§parent_session_id: Option<SessionId>

Parent session ID (if this is a subagent)

§child_session_ids: Vec<SessionId>

Child subagent session IDs

§first_prompt: Option<String>

First user prompt (for preview summary)

Implementations§

Source§

impl SessionView

Source

pub fn from_domain(session: &SessionDomain) -> Self

Creates a SessionView from a SessionDomain.

Trait Implementations§

Source§

impl Clone for SessionView

Source§

fn clone(&self) -> SessionView

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 SessionView

Source§

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

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

impl Default for SessionView

Source§

fn default() -> SessionView

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SessionView

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 From<&SessionDomain> for SessionView

Source§

fn from(session: &SessionDomain) -> Self

Converts to this type from the input type.
Source§

impl Serialize for SessionView

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

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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