[][src]Struct twilight_embed_builder::footer::EmbedFooterBuilder

#[must_use = "must be built into an embed footer"]pub struct EmbedFooterBuilder(_);

Create an embed footer with a builder.

This can be passed into EmbedBuilder::footer.

Implementations

impl EmbedFooterBuilder[src]

pub const TEXT_LENGTH_LIMIT: usize[src]

The maximum number of UTF-16 code points that can be in a footer's text.

pub fn new(text: impl Into<String>) -> Result<Self, EmbedFooterTextError>[src]

Create a new default embed footer builder.

Refer to TEXT_LENGTH_LIMIT for the maximum number of UTF-16 code points that can be in a footer's text.

Errors

Returns EmbedFooterTextError::Empty if the provided text is empty.

Returns EmbedFooterTextError::TooLong if the provided text is longer than the limit defined at TEXT_LENGTH_LIMIT.

#[must_use = "should be used as part of an embed builder"]pub fn build(self) -> EmbedFooter[src]

Build into an embed footer.

pub fn icon_url(self, image_source: ImageSource) -> Self[src]

Add a footer icon.

Examples

Create a footer by Twilight with a URL to an image of its logo:

use twilight_embed_builder::{EmbedFooterBuilder, ImageSource};

let icon_url = ImageSource::url("https://raw.githubusercontent.com/twilight-rs/twilight/trunk/logo.png")?;
let footer = EmbedFooterBuilder::new("Twilight")?
    .icon_url(icon_url)
    .build();

Trait Implementations

impl Clone for EmbedFooterBuilder[src]

impl Debug for EmbedFooterBuilder[src]

impl Eq for EmbedFooterBuilder[src]

impl From<EmbedFooterBuilder> for EmbedFooter[src]

fn from(builder: EmbedFooterBuilder) -> Self[src]

Convert an embed footer builder into an embed footer.

This is equivalent to calling EmbedFooterBuilder::build.

impl PartialEq<EmbedFooterBuilder> for EmbedFooterBuilder[src]

impl StructuralEq for EmbedFooterBuilder[src]

impl StructuralPartialEq for EmbedFooterBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.