pub enum StreamEvent {
TextDelta(String),
ThinkingDelta(String),
ToolUseStart {
name: String,
},
Usage(Usage),
}Expand description
Incremental output, emitted only when a sink is supplied.
Variants§
TextDelta(String)
ThinkingDelta(String)
ToolUseStart
A tool call has begun; arguments are still streaming.
Usage(Usage)
Everything known about this turn’s token usage so far, cumulative.
Emitted as it arrives rather than only at the end, because cancelling a run drops the provider future and with it the final frame that carries the totals. Without this, a run interrupted on its first turn reports zero tokens — and the tokens were spent. Input is usually known from the very first frame, which is the expensive half when a cached prefix is in play.
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
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 StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnsafeUnpin for StreamEvent
impl UnwindSafe for StreamEvent
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