pub enum Content {
Text(String),
Parts(Vec<ContentPart>),
}Expand description
Message content: a plain string when there is only text, else an array of parts.
Untagged so it serialises as a bare string or a bare array, matching the wire.
Variants§
Text(String)
Parts(Vec<ContentPart>)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Content
impl<'de> Deserialize<'de> for Content
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
Source§impl From<Vec<ContentPart>> for Content
impl From<Vec<ContentPart>> for Content
Source§fn from(p: Vec<ContentPart>) -> Self
fn from(p: Vec<ContentPart>) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Content
Auto Trait Implementations§
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnsafeUnpin for Content
impl UnwindSafe for Content
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