pub struct SessionReader;Expand description
Reads a session JSONL file and reconstructs transcript entries.
Corrupt lines are skipped silently — the rest of the file is still readable. This makes resume resilient to partial writes.
Implementations§
Source§impl SessionReader
impl SessionReader
Sourcepub fn read_records(path: &Path) -> Vec<SessionRecord>
pub fn read_records(path: &Path) -> Vec<SessionRecord>
Read a session file and return all records, in order.
Corrupt lines are skipped. Returns an empty vec if the file does not exist.
Sourcepub fn read_records_from_tail(
path: &Path,
max_bytes: usize,
) -> Vec<SessionRecord>
pub fn read_records_from_tail( path: &Path, max_bytes: usize, ) -> Vec<SessionRecord>
Read only the trailing portion of a session file.
If the bounded read starts in the middle of a JSONL record, that first partial record is discarded. This is suitable for bounded input recall, where recent turns matter more than a full historical reconstruction.
Sourcepub fn read_transcript(path: &Path) -> Vec<Entry>
pub fn read_transcript(path: &Path) -> Vec<Entry>
Read a session file and reconstruct the transcript.
Only records that map to Entry values are included. Metadata
records (session_meta, context, session_renamed) are skipped.
Sourcepub fn read_title(path: &Path) -> String
pub fn read_title(path: &Path) -> String
Read the session title from a session file.
Returns the latest session_renamed title, or the initial
session_meta title, or the file stem as a fallback.
Sourcepub fn read_summary(path: &Path) -> SessionSummary
pub fn read_summary(path: &Path) -> SessionSummary
Read compact sidebar metadata from a session file.
Sourcepub fn read_redacted_records(path: &Path) -> Vec<Value>
pub fn read_redacted_records(path: &Path) -> Vec<Value>
Read a renderer-independent, redacted JSON projection of every valid record in sequence order. Malformed lines remain omitted just as they are for transcript recovery.
Auto Trait Implementations§
impl Freeze for SessionReader
impl RefUnwindSafe for SessionReader
impl Send for SessionReader
impl Sync for SessionReader
impl Unpin for SessionReader
impl UnsafeUnpin for SessionReader
impl UnwindSafe for SessionReader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more