Struct Embed
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
A message’s rich embed as the protocol has it (Message::embeds); build one to send with
EmbedBuilder.
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§
§impl Embed
impl Embed
pub 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§
§impl<'de> Deserialize<'de> for Embed
impl<'de> Deserialize<'de> for Embed
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Embed, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Embed, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Embed
Source§impl From<Embed> for EmbedBuilder
impl From<Embed> for EmbedBuilder
Source§fn from(embed: Embed) -> Self
fn from(embed: Embed) -> Self
An embed as received (Message::embeds), to send again or
change: its pictures stay the attachments it names.