pub enum Part {
Text {
text: String,
},
File {
file: FileContent,
},
Data {
data: Value,
},
Unknown,
}Expand description
Content part types: text, file, or structured data
Variants§
Text
Plain text content
File
File content (URI or inline bytes)
Fields
§
file: FileContentFile content details
Data
Structured JSON data
Unknown
Catch-all for unknown part types added by the A2A spec.
Implementations§
Source§impl Part
impl Part
Sourcepub fn file_uri(uri: impl Into<String>, mime_type: Option<String>) -> Self
pub fn file_uri(uri: impl Into<String>, mime_type: Option<String>) -> Self
Create a file part from URI
Sourcepub fn file_bytes(
bytes: Vec<u8>,
mime_type: Option<String>,
name: Option<String>,
) -> Self
pub fn file_bytes( bytes: Vec<u8>, mime_type: Option<String>, name: Option<String>, ) -> Self
Create a file part from inline bytes
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if this is an unknown/unsupported part type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Part
impl<'de> Deserialize<'de> for Part
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 Part
impl RefUnwindSafe for Part
impl Send for Part
impl Sync for Part
impl Unpin for Part
impl UnsafeUnpin for Part
impl UnwindSafe for Part
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