#[non_exhaustive]pub enum ContentPrimitive {
Text {
text: String,
},
Image(Image),
Document(Document),
Audio(Audio),
Video(Video),
}Expand description
A single content primitive within a Content::Multi list.
Mirrors the Python SDK’s ContentPrimitive = str | Image | Document | Audio | Video.
Why both ContentPrimitive and Content?
ContentPrimitive represents a single, non-compound element —
it deliberately excludes the Multi variant that Content provides.
This separation enforces the invariant that multimodal lists are flat
(you cannot nest a Content::Multi inside another Multi), while
Content remains the top-level union accepted by agent.chat().
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
Plain text content.
Image(Image)
An image attachment.
Document(Document)
A document attachment.
Audio(Audio)
An audio attachment.
Video(Video)
A video attachment.
Trait Implementations§
Source§impl Clone for ContentPrimitive
impl Clone for ContentPrimitive
Source§fn clone(&self) -> ContentPrimitive
fn clone(&self) -> ContentPrimitive
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ContentPrimitive
impl Debug for ContentPrimitive
Source§impl<'de> Deserialize<'de> for ContentPrimitive
impl<'de> Deserialize<'de> for ContentPrimitive
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 Eq for ContentPrimitive
Source§impl PartialEq for ContentPrimitive
impl PartialEq for ContentPrimitive
Source§fn eq(&self, other: &ContentPrimitive) -> bool
fn eq(&self, other: &ContentPrimitive) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContentPrimitive
impl Serialize for ContentPrimitive
impl StructuralPartialEq for ContentPrimitive
Auto Trait Implementations§
impl Freeze for ContentPrimitive
impl RefUnwindSafe for ContentPrimitive
impl Send for ContentPrimitive
impl Sync for ContentPrimitive
impl Unpin for ContentPrimitive
impl UnsafeUnpin for ContentPrimitive
impl UnwindSafe for ContentPrimitive
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