pub struct TurnResult {
pub state: SessionSnapshot,
pub outcome: TurnOutcome,
pub assistant_output: AssistantOutput,
pub usage: TokenUsage,
pub children_usage: Vec<TokenLedgerEntry>,
pub tool_calls: Vec<ToolCallRecord>,
pub execution: ExecutionSummary,
pub errors: Vec<TurnIssue>,
}Fields§
§state: SessionSnapshot§outcome: TurnOutcome§assistant_output: AssistantOutput§usage: TokenUsageParent’s own LLM tokens for this turn. Does not include child
sessions; see children_usage and
total_usage.
children_usage: Vec<TokenLedgerEntry>Per-(source, model) ledger entries for child sessions whose LLM
calls completed during this turn (subagents, compaction, observers,
etc.). Empty unless the turn spawned children.
tool_calls: Vec<ToolCallRecord>§execution: ExecutionSummary§errors: Vec<TurnIssue>Implementations§
Source§impl TurnResult
impl TurnResult
Sourcepub fn total_usage(&self) -> TokenUsage
pub fn total_usage(&self) -> TokenUsage
Sum of parent’s own LLM tokens and every child session’s LLM tokens for this turn.
pub fn assistant_message(&self) -> Option<&str>
pub fn submitted_value(&self) -> Option<&Value>
pub fn tool_value(&self) -> Option<(&str, &Value)>
pub fn is_success(&self) -> bool
Trait Implementations§
Source§impl Clone for TurnResult
impl Clone for TurnResult
Source§fn clone(&self) -> TurnResult
fn clone(&self) -> TurnResult
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 moreSource§impl Debug for TurnResult
impl Debug for TurnResult
Source§impl<'de> Deserialize<'de> for TurnResult
impl<'de> Deserialize<'de> for TurnResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TurnResult
impl RefUnwindSafe for TurnResult
impl Send for TurnResult
impl Sync for TurnResult
impl Unpin for TurnResult
impl UnsafeUnpin for TurnResult
impl UnwindSafe for TurnResult
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