#[non_exhaustive]pub enum Part {
Text {
content: String,
metadata: Option<Value>,
mediaType: Option<String>,
filename: Option<String>,
},
Raw {
bytes: String,
mediaType: String,
metadata: Option<Value>,
filename: Option<String>,
},
Url {
url: String,
mediaType: Option<String>,
metadata: Option<Value>,
filename: Option<String>,
},
Data {
data: Value,
metadata: Option<Value>,
mediaType: Option<String>,
filename: Option<String>,
},
Unknown,
}Expand description
One element of a multi-part payload — A2A spec §6.2.
Tagged enum on "type". Optional metadata, filename, and
mediaType are present on every variant per the spec.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
UTF-8 text part.
Fields
Raw
Inline binary blob, base64-encoded.
Fields
Url
External resource reference.
Fields
Data
Arbitrary structured JSON.
Fields
Unknown
An unrecognized part type from a newer peer. Deserialization maps any
unknown "type" here instead of failing, preserving forward-compat.
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