#[non_exhaustive]pub enum MessageEvent {
TextChunk {
text: String,
},
ToolUse {
id: String,
name: String,
input: Value,
},
ToolResult {
tool_use_id: String,
success: bool,
output: String,
},
ApiRetry {
attempt: u32,
message: String,
},
RateLimit {
message: String,
},
Thinking {
text: String,
},
ResultDone {
cost: AgentCost,
content: String,
is_error: bool,
},
Error {
message: String,
},
}Expand description
Event emitted by a streaming query.
#[non_exhaustive] — new variants may be added in minor versions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TextChunk
A chunk of assistant text content.
ToolUse
The model started a tool call.
ToolResult
A tool finished executing.
ApiRetry
Provider is retrying an API request.
RateLimit
Upstream rate limit notification.
Thinking
Extended-thinking content (Claude only).
ResultDone
Terminal event: the query is done. Contains final cost.
Error
Terminal event: the query failed.
Trait Implementations§
Source§impl Clone for MessageEvent
impl Clone for MessageEvent
Source§fn clone(&self) -> MessageEvent
fn clone(&self) -> MessageEvent
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 moreSource§impl Debug for MessageEvent
impl Debug for MessageEvent
Source§impl<'de> Deserialize<'de> for MessageEvent
impl<'de> Deserialize<'de> for MessageEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for MessageEvent
impl Serialize for MessageEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for MessageEvent
impl RefUnwindSafe for MessageEvent
impl Send for MessageEvent
impl Sync for MessageEvent
impl Unpin for MessageEvent
impl UnsafeUnpin for MessageEvent
impl UnwindSafe for MessageEvent
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