[][src]Struct spectacles_model::message::Embed

pub struct Embed {
    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>,
}

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.

footer: Option<EmbedFooter>

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.

author: Option<EmbedAuthor>

Information about the embed's author.

fields: Vec<EmbedField>

Information about the embed's fields.

Methods

impl Embed[src]

pub fn new() -> Self[src]

pub fn set_title(self, text: impl Into<String>) -> Self[src]

Sets the title for this embed.

pub fn set_description(self, text: impl Into<String>) -> Self[src]

Sets the description of this embed.

pub fn set_color(self, code: i32) -> Self[src]

Sets the color of this embed.

pub fn add_field<F: FnOnce(EmbedField) -> EmbedField>(self, builder: F) -> Self[src]

Adds a field to this embed.

pub fn set_author<F>(self, author: F) -> Self where
    F: FnOnce(EmbedAuthor) -> EmbedAuthor
[src]

Sets the author of this embed.

Sets the footer of this embed.

pub fn set_thumbnail<T>(self, thumb: T) -> Self where
    T: FnOnce(EmbedThumbnail) -> EmbedThumbnail
[src]

Adds a thumbnail to this embed.

pub fn set_image<F>(self, img: F) -> Self where
    F: FnOnce(EmbedImage) -> EmbedImage
[src]

Adds an image to this embed.

pub fn set_current_timestamp(self) -> Self[src]

pub fn set_timestamp(self, time: DateTime<Utc>) -> Self[src]

Trait Implementations

impl MessageResponse for Embed[src]

impl Clone for Embed[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Embed[src]

impl Debug for Embed[src]

impl Serialize for Embed[src]

impl<'de> Deserialize<'de> for Embed[src]

Auto Trait Implementations

impl Send for Embed

impl Sync for Embed

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]