pub enum Part {
Text {
text: String,
metadata: Option<Value>,
},
File {
file: FileContent,
metadata: Option<Value>,
},
Data {
data: Value,
metadata: Option<Value>,
},
}Expand description
A typed content part within a Message or Artifact.
The A2A spec uses a tagged union ("kind" discriminant) so that clients and agents
can safely ignore part types they do not understand. Use Part::text to construct
the most common variant without boilerplate.
§Examples
use zeph_a2a::{Part};
let text_part = Part::text("Hello!");
assert!(matches!(text_part, Part::Text { .. }));Variants§
Text
Plain or markdown text content.
File
Binary or URI-referenced file attachment.
Data
Arbitrary structured JSON data (e.g., tool call results, structured output).
Implementations§
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
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