Enum TurnEvent
pub enum TurnEvent {
Chunk {
delta: String,
},
Thinking {
delta: String,
},
ToolCall {
id: String,
name: String,
args: Value,
},
ToolResult {
id: String,
name: String,
output: String,
artifact: Option<ToolArtifact>,
},
Plan {
entries: Vec<PlanEntry>,
},
ApprovalRequest {
request_id: String,
tool_name: String,
arguments_summary: String,
timeout_secs: u64,
},
HistoryTrimmed {
dropped_messages: usize,
kept_turns: usize,
reason: String,
},
Usage {
input_tokens: Option<u64>,
cached_input_tokens: Option<u64>,
output_tokens: Option<u64>,
cost_usd: Option<f64>,
},
}Variants§
Chunk
A text chunk from the LLM response (may arrive many times).
Thinking
A reasoning/thinking chunk from a thinking model (may arrive many times).
ToolCall
The agent is invoking a tool.
Fields
id: StringStable correlation ID shared with the matching TurnEvent::ToolResult.
ToolResult
A tool has returned a result.
Fields
id: StringStable correlation ID shared with the originating TurnEvent::ToolCall.
artifact: Option<ToolArtifact>Typed metadata for a file-producing tool (e.g. deliver_file), so
channels attach the file structurally instead of parsing output.
None for ordinary tools.
Plan
ApprovalRequest
Fields
HistoryTrimmed
Older whole turns were dropped to fit either the context token budget or the configured message limit. Surfaces a user-visible “context was cut here” marker so trimming is never silent. Emitted whenever a trim occurs.
Usage
Per-LLM-call token usage and cost; a turn may emit several, one per
model call. None means “unavailable for this call”, not zero.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TurnEvent
impl RefUnwindSafe for TurnEvent
impl Send for TurnEvent
impl Sync for TurnEvent
impl Unpin for TurnEvent
impl UnsafeUnpin for TurnEvent
impl UnwindSafe for TurnEvent
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more