pub enum Message {
User {
content: String,
},
Assistant {
content: String,
},
ToolResult {
tool_name: String,
result: String,
},
}Expand description
Simplified message type for V2 API
This is a simplified version of the full Message type,
containing only the most essential information.
§Variants
User- Message from the userAssistant- Response from ClaudeToolResult- Result from a tool execution
Variants§
Implementations§
Source§impl Message
impl Message
Sourcepub fn is_assistant(&self) -> bool
pub fn is_assistant(&self) -> bool
Check if this is an assistant message
Sourcepub fn is_tool_result(&self) -> bool
pub fn is_tool_result(&self) -> bool
Check if this is a tool result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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 Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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