pub struct Folio {
pub source: PathBuf,
pub turns: Vec<Turn>,
}Expand description
One rendered session: the unit the tool turns into a single HTML file.
Fields§
§source: PathBuf§turns: Vec<Turn>Implementations§
Source§impl Folio
impl Folio
Sourcepub fn read(source: &Path) -> Result<Self>
pub fn read(source: &Path) -> Result<Self>
Reads a session JSONL file, keeping only the lines that carry conversation.
pub fn session_id(&self) -> &str
Sourcepub fn peek(source: &Path) -> SessionPeek
pub fn peek(source: &Path) -> SessionPeek
Cheaply scans a session’s listing metadata (its title and working
directory) without parsing the conversation, tolerating malformed lines
so one bad session never breaks a picker that lists every session. This
is deliberately lenient where Folio::read is strict: a label is
best-effort, a render is not.
Sourcepub fn output(&self) -> Option<u64>
pub fn output(&self) -> Option<u64>
The output across the session, or None when no turn reports usage.
Output totals, since each turn produces its own.
Sourcepub fn largest_input(&self) -> Option<u64>
pub fn largest_input(&self) -> Option<u64>
The largest input any one turn took, or None when no turn reports
usage: how big the conversation ever got. A high-water mark rather than
a sum, since every turn is sent the whole conversation and summing that
would count the same text once per turn that saw it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Folio
impl RefUnwindSafe for Folio
impl Send for Folio
impl Sync for Folio
impl Unpin for Folio
impl UnsafeUnpin for Folio
impl UnwindSafe for Folio
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> 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