pub struct TurnRecord {
pub result: QueryResult,
}Expand description
A record of a single turn within a session.
Fields§
§result: QueryResultThe typed result for this turn, assembled from its JSONL events.
Holding the assembled QueryResult rather than the raw event vector
is what lets a session report usage: token counts live on the terminal
turn.completed event and are otherwise discarded.
Implementations§
Source§impl TurnRecord
impl TurnRecord
Sourcepub fn events(&self) -> &[JsonLineEvent]
pub fn events(&self) -> &[JsonLineEvent]
The parsed JSONL events returned by this turn.
Sourcepub fn usage(&self) -> Option<TokenUsage>
pub fn usage(&self) -> Option<TokenUsage>
Token counts for this turn, if the CLI reported them.
Trait Implementations§
Source§impl Clone for TurnRecord
impl Clone for TurnRecord
Auto Trait Implementations§
impl Forget for TurnRecord
impl Freeze for TurnRecord
impl RefUnwindSafe for TurnRecord
impl Send for TurnRecord
impl Sync for TurnRecord
impl Unpin for TurnRecord
impl UnsafeUnpin for TurnRecord
impl UnwindSafe for TurnRecord
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