pub struct StreamingResult {
pub content: String,
pub tool_calls: Vec<Value>,
pub usage: TokenUsage,
pub api_error: Option<String>,
pub ttft_ms: Option<u64>,
pub stop_reason: Option<String>,
pub cost: f64,
pub message_started: bool,
pub content_blocks_started: u32,
pub content_blocks_completed: u32,
pub any_tool_use_completed: bool,
pub research: Option<Value>,
}Expand description
Streaming result containing accumulated content, tool calls, and metadata. Matches TypeScript’s partialMessage + newMessages + usage + cost accumulation.
Fields§
§content: StringAccumulated text content from all content blocks
tool_calls: Vec<Value>Accumulated tool calls (completed tool_use blocks)
usage: TokenUsageToken usage information
api_error: Option<String>API error type if any (e.g., “max_output_tokens”, “prompt_too_long”)
ttft_ms: Option<u64>Time to first token in milliseconds
stop_reason: Option<String>The stop_reason from message_delta (e.g., “end_turn”, “tool_use”, “max_tokens”)
cost: f64Total cost in USD for this request
message_started: boolWhether message_start event was received
content_blocks_started: u32Number of content blocks that were started
content_blocks_completed: u32Number of content blocks that were completed
any_tool_use_completed: boolWhether any tool_use blocks were completed
research: Option<Value>Research data from message_start (internal only, for ant userType)
Trait Implementations§
Source§impl Clone for StreamingResult
impl Clone for StreamingResult
Source§fn clone(&self) -> StreamingResult
fn clone(&self) -> StreamingResult
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 StreamingResult
impl Debug for StreamingResult
Auto Trait Implementations§
impl Freeze for StreamingResult
impl RefUnwindSafe for StreamingResult
impl Send for StreamingResult
impl Sync for StreamingResult
impl Unpin for StreamingResult
impl UnsafeUnpin for StreamingResult
impl UnwindSafe for StreamingResult
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