pub enum Part {
Text {
text: String,
metadata: Option<Value>,
},
File {
file: FileContent,
metadata: Option<Value>,
},
Data {
data: Value,
metadata: Option<Value>,
},
}Expand description
Part content — flat proto-JSON format per A2A v1.0 spec.
Uses custom serialization to produce flat JSON without a kind discriminator:
Part::Text→{"text": "..."}Part::File→{"file": {"uri": "...", "mimeType": "..."}}Part::Data→{"data": {...}}
Deserialization detects the variant by which field is present.
Variants§
Text
Text content part
File
File content part (inline bytes or URI reference)
Data
Structured data part
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Part
impl<'de> Deserialize<'de> for Part
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Part
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