pub struct CardElement {
pub title: Option<String>,
pub children: Vec<CardChild>,
pub fallback_text: Option<String>,
}Expand description
A card is a structured rich message composed of child elements.
Fields§
§title: Option<String>Optional title displayed at the top of the card.
children: Vec<CardChild>Ordered list of child elements that make up the card body.
fallback_text: Option<String>When set, render_card_as_text returns this verbatim instead of
building text from the element tree.
Implementations§
Source§impl CardElement
impl CardElement
Sourcepub fn section(self, section: SectionElement) -> Self
pub fn section(self, section: SectionElement) -> Self
Append a section child.
Sourcepub fn actions(self, actions: ActionsElement) -> Self
pub fn actions(self, actions: ActionsElement) -> Self
Append an actions child.
Sourcepub fn image(self, image: ImageElement) -> Self
pub fn image(self, image: ImageElement) -> Self
Append an image child.
Sourcepub fn fields(self, fields: FieldsElement) -> Self
pub fn fields(self, fields: FieldsElement) -> Self
Append a fields child.
Sourcepub fn text(self, text: TextElement) -> Self
pub fn text(self, text: TextElement) -> Self
Append a text child.
Sourcepub fn fallback_text(self, text: impl Into<String>) -> Self
pub fn fallback_text(self, text: impl Into<String>) -> Self
Set explicit fallback text (used by render_card_as_text).
Trait Implementations§
Source§impl Clone for CardElement
impl Clone for CardElement
Source§fn clone(&self) -> CardElement
fn clone(&self) -> CardElement
Returns a duplicate of the value. Read more
1.0.0 · 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 CardElement
impl Debug for CardElement
Source§impl Default for CardElement
impl Default for CardElement
Source§impl<'de> Deserialize<'de> for CardElement
impl<'de> Deserialize<'de> for CardElement
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 CardElement
impl RefUnwindSafe for CardElement
impl Send for CardElement
impl Sync for CardElement
impl Unpin for CardElement
impl UnsafeUnpin for CardElement
impl UnwindSafe for CardElement
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