pub struct Embed {
pub title: Option<String>,
pub description: Option<String>,
pub url: Option<String>,
pub color: Option<u32>,
pub timestamp: Option<u64>,
pub author: Option<EmbedAuthor>,
pub footer: Option<EmbedFooter>,
pub image: Option<AttachmentId>,
pub thumbnail: Option<AttachmentId>,
pub fields: Vec<EmbedField>,
}Expand description
An embed (§8.5). Every text is optional, but an embed shows something: a title, a
description, an author, a footer, a picture or a field (color, timestamp and url
alone do not count).
Fields§
§title: Option<String>1–256 scalars.
description: Option<String>1–4 096 scalars.
url: Option<String>The title’s link: https:// only, ≤ 2 048 bytes, no whitespace or control
characters. Needs a title.
color: Option<u32>0x000000–0xFFFFFF.
timestamp: Option<u64>A time the embed shows, ms since the epoch (< 2^53).
The author line.
The footer line.
image: Option<AttachmentId>The large picture: one of the message’s attachments.
thumbnail: Option<AttachmentId>The small picture: one of the message’s attachments.
fields: Vec<EmbedField>Up to 25 fields, in order.
Implementations§
Source§impl Embed
impl Embed
Sourcepub fn attachments(
&self,
) -> impl Iterator<Item = (&'static str, AttachmentId)> + '_
pub fn attachments( &self, ) -> impl Iterator<Item = (&'static str, AttachmentId)> + '_
The attachments this embed shows, with the field that names each: embeds.image,
embeds.thumbnail, embeds.author.icon, embeds.footer.icon.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Embed
impl<'de> Deserialize<'de> for Embed
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 Embed
impl StructuralPartialEq for Embed
Auto Trait Implementations§
impl Freeze for Embed
impl RefUnwindSafe for Embed
impl Send for Embed
impl Sync for Embed
impl Unpin for Embed
impl UnsafeUnpin for Embed
impl UnwindSafe for Embed
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