pub struct CreateMessageResult {
pub model: String,
pub stop_reason: Option<String>,
pub message: SamplingMessage,
}Expand description
Create message result (MCP 2025-11-25)
Response from a sampling request.
Fields§
§model: StringModel identifier that generated the response
stop_reason: Option<String>Reason generation stopped
message: SamplingMessageGenerated message content
Implementations§
Source§impl CreateMessageResult
impl CreateMessageResult
Sourcepub fn is_tool_use(&self) -> bool
pub fn is_tool_use(&self) -> bool
Check if the model wants to use a tool
Sourcepub fn is_end_turn(&self) -> bool
pub fn is_end_turn(&self) -> bool
Check if generation ended normally
Sourcepub fn is_max_tokens(&self) -> bool
pub fn is_max_tokens(&self) -> bool
Check if generation hit the token limit
Trait Implementations§
Source§impl Clone for CreateMessageResult
impl Clone for CreateMessageResult
Source§fn clone(&self) -> CreateMessageResult
fn clone(&self) -> CreateMessageResult
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateMessageResult
impl Debug for CreateMessageResult
Source§impl<'de> Deserialize<'de> for CreateMessageResult
impl<'de> Deserialize<'de> for CreateMessageResult
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 CreateMessageResult
impl RefUnwindSafe for CreateMessageResult
impl Send for CreateMessageResult
impl Sync for CreateMessageResult
impl Unpin for CreateMessageResult
impl UnwindSafe for CreateMessageResult
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)