pub enum MessagePart {
Text {
text: String,
},
File {
file: FileContent,
},
Data {
data: Value,
},
}Expand description
A part of a message
According to the A2A spec: “A Part MUST contain exactly one of the following: text, file, data”
Variants§
Text
Text content
File
File reference
Fields
§
file: FileContentFile content (nested structure per spec v1.0+)
Data
Structured data
Implementations§
Source§impl MessagePart
impl MessagePart
Sourcepub fn file(name: impl Into<String>, file_uri: impl Into<String>) -> Self
pub fn file(name: impl Into<String>, file_uri: impl Into<String>) -> Self
Create a file part with URI reference
Sourcepub fn file_with_type(
name: impl Into<String>,
file_uri: impl Into<String>,
media_type: impl Into<String>,
) -> Self
pub fn file_with_type( name: impl Into<String>, file_uri: impl Into<String>, media_type: impl Into<String>, ) -> Self
Create a file part with URI and media type
Trait Implementations§
Source§impl Clone for MessagePart
impl Clone for MessagePart
Source§fn clone(&self) -> MessagePart
fn clone(&self) -> MessagePart
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 MessagePart
impl Debug for MessagePart
Source§impl<'de> Deserialize<'de> for MessagePart
impl<'de> Deserialize<'de> for MessagePart
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 MessagePart
impl PartialEq for MessagePart
Source§impl Serialize for MessagePart
impl Serialize for MessagePart
impl StructuralPartialEq for MessagePart
Auto Trait Implementations§
impl Freeze for MessagePart
impl RefUnwindSafe for MessagePart
impl Send for MessagePart
impl Sync for MessagePart
impl Unpin for MessagePart
impl UnwindSafe for MessagePart
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