pub struct UserMessage {
pub text: String,
pub attachments: Option<Vec<MessageAttachment>>,
pub meta: Option<JsonObject>,
}Expand description
A user message and its associated attachments.
Attachments MAY be referenced inside {@link UserMessage.text} via their {@link MessageAttachmentBase.range} field. Attachments without a range are still associated with the message but do not correspond to a specific span in the text.
Fields§
§text: StringMessage text
attachments: Option<Vec<MessageAttachment>>File/selection attachments
meta: Option<JsonObject>Additional provider-specific metadata for this message.
Clients MAY look for well-known keys here to provide enhanced UI, and
agent hosts MAY use it to carry context that does not fit any other
field. Mirrors the MCP _meta convention.
Trait Implementations§
Source§impl Clone for UserMessage
impl Clone for UserMessage
Source§fn clone(&self) -> UserMessage
fn clone(&self) -> UserMessage
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 UserMessage
impl Debug for UserMessage
Source§impl<'de> Deserialize<'de> for UserMessage
impl<'de> Deserialize<'de> for UserMessage
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
Source§impl PartialEq for UserMessage
impl PartialEq for UserMessage
Source§fn eq(&self, other: &UserMessage) -> bool
fn eq(&self, other: &UserMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UserMessage
impl Serialize for UserMessage
impl StructuralPartialEq for UserMessage
Auto Trait Implementations§
impl Freeze for UserMessage
impl RefUnwindSafe for UserMessage
impl Send for UserMessage
impl Sync for UserMessage
impl Unpin for UserMessage
impl UnsafeUnpin for UserMessage
impl UnwindSafe for UserMessage
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