pub struct Session {
pub id: String,
pub file_path: PathBuf,
pub lines: Vec<RolloutLine>,
}Expand description
A parsed session: the sequence of lines plus derived first-line metadata and a reference to the file on disk.
Fields§
§id: String§file_path: PathBuf§lines: Vec<RolloutLine>Implementations§
Source§impl Session
impl Session
Sourcepub fn meta(&self) -> Option<SessionMeta>
pub fn meta(&self) -> Option<SessionMeta>
The first session_meta item if one exists (Codex always
writes it as line 1, but we guard against truncation).
Sourcepub fn items(&self) -> impl Iterator<Item = RolloutItem> + '_
pub fn items(&self) -> impl Iterator<Item = RolloutItem> + '_
Iterate over typed items.
pub fn started_at(&self) -> Option<DateTime<Utc>>
pub fn last_activity(&self) -> Option<DateTime<Utc>>
Sourcepub fn first_user_text(&self) -> Option<String>
pub fn first_user_text(&self) -> Option<String>
First user-message text in the session, if any.
Prefers event_msg.user_message — Codex emits that for genuine
user input as seen by the TUI. response_item.message with
role: "user" is less reliable: Codex routinely injects
synthetic user messages (<environment_context>, AGENTS.md
contents) ahead of the real prompt. Falls back to the first
response_item user message only when no user_message event
is present.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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