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
Source§fn clone(&self) -> TurnRecord
fn clone(&self) -> TurnRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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