pub struct TurnResult {
pub state: SessionSnapshot,
pub outcome: TurnOutcome,
pub assistant_output: AssistantOutput,
pub usage: TokenUsage,
pub children_usage: Vec<TokenLedgerEntry>,
pub llm_calls: Vec<LlmCallRecord>,
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.
llm_calls: Vec<LlmCallRecord>Provider calls made by the parent session during this turn, in protocol order. Child-session calls remain on each child’s result. This is the complete lash-side model attribution surface: a turn has no single producing model, so lash exposes the per-call ledger and the host composes any higher-level view from it (ADR 0033).
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.
Sourcepub fn started_at(&self) -> SystemTime
pub fn started_at(&self) -> SystemTime
Wall-clock instant the runtime started this turn (claim of the
session-execution lease / queued-work claim), read from the runtime
clock. Backed by ExecutionSummary::started_at_ms on
execution.
Sourcepub fn duration(&self) -> Duration
pub fn duration(&self) -> Duration
Whole-turn duration — claim through final commit and post-persist
hooks — measured on the runtime clock’s monotonic source. Backed by
ExecutionSummary::duration_ms on execution.
pub fn assistant_message(&self) -> Option<&str>
pub fn final_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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more