pub struct Embed {Show 13 fields
pub title: Option<String>,
pub kind: Option<String>,
pub description: Option<String>,
pub url: Option<String>,
pub timestamp: Option<DateTime<Utc>>,
pub color: Option<i32>,
pub footer: Option<EmbedFooter>,
pub image: Option<EmbedImage>,
pub thumbnail: Option<EmbedThumbnail>,
pub video: Option<EmbedVideo>,
pub provider: Option<EmbedProvider>,
pub author: Option<EmbedAuthor>,
pub fields: Vec<EmbedField>,
}
Expand description
Represents a Message Embed being sent.
Fields§
§title: Option<String>
The title of the embed.
kind: Option<String>
The type of embed.
description: Option<String>
The description of the embed.
url: Option<String>
The URL of the embed.
timestamp: Option<DateTime<Utc>>
The timestamp of the embed.
color: Option<i32>
The color of the embed.
Information about the embed’s footer.
image: Option<EmbedImage>
Information about the embed’s image.
thumbnail: Option<EmbedThumbnail>
Information about the embed’s thumbnail.
video: Option<EmbedVideo>
Information about an embed’s video, if applicable.
provider: Option<EmbedProvider>
Information about an embed’s provider if applicable.
Information about the embed’s author.
fields: Vec<EmbedField>
Information about the embed’s fields.
Implementations§
Source§impl Embed
impl Embed
pub fn new() -> Self
Sourcepub fn set_description(self, text: impl Into<String>) -> Self
pub fn set_description(self, text: impl Into<String>) -> Self
Sets the description of this embed.
Sourcepub fn add_field<F: FnOnce(EmbedField) -> EmbedField>(self, builder: F) -> Self
pub fn add_field<F: FnOnce(EmbedField) -> EmbedField>(self, builder: F) -> Self
Adds a field to this embed.
Sets the author of this embed.
Sets the footer of this embed.
Sourcepub fn set_thumbnail<T>(self, thumb: T) -> Self
pub fn set_thumbnail<T>(self, thumb: T) -> Self
Adds a thumbnail to this embed.
pub fn set_current_timestamp(self) -> Self
pub fn set_timestamp(self, time: DateTime<Utc>) -> Self
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
Source§impl MessageResponse for Embed
impl MessageResponse for Embed
fn as_message(self) -> CreateMessageOptions
Auto Trait Implementations§
impl Freeze for Embed
impl RefUnwindSafe for Embed
impl Send for Embed
impl Sync for Embed
impl Unpin 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