pub struct TurnSnapshot {
pub turn_index: usize,
pub messages: Arc<Vec<LlmMessage>>,
pub usage: Usage,
pub cost: Cost,
pub stop_reason: StopReason,
pub state_delta: Option<StateDelta>,
}Expand description
A point-in-time snapshot of agent state at a turn boundary.
Emitted as part of TurnEnd events to support external replay, auditing,
and debugging. Contains the full context at the moment the turn completed.
Fields§
§turn_index: usizeZero-based index of this turn within the current agent loop run.
messages: Arc<Vec<LlmMessage>>The LLM messages present in the context at the turn boundary.
Wrapped in Arc to avoid cloning the full message list when the
snapshot is forwarded to multiple subscribers.
usage: UsageAccumulated token usage up to and including this turn.
cost: CostAccumulated cost up to and including this turn.
stop_reason: StopReasonStop reason from the assistant message that ended this turn.
state_delta: Option<StateDelta>Session state changes during this turn, if any.
Trait Implementations§
Source§impl Clone for TurnSnapshot
impl Clone for TurnSnapshot
Source§fn clone(&self) -> TurnSnapshot
fn clone(&self) -> TurnSnapshot
Returns a duplicate of the value. Read more
1.0.0 · 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 TurnSnapshot
impl Debug for TurnSnapshot
Source§impl<'de> Deserialize<'de> for TurnSnapshot
impl<'de> Deserialize<'de> for TurnSnapshot
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 TurnSnapshot
impl RefUnwindSafe for TurnSnapshot
impl Send for TurnSnapshot
impl Sync for TurnSnapshot
impl Unpin for TurnSnapshot
impl UnsafeUnpin for TurnSnapshot
impl UnwindSafe for TurnSnapshot
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