[−][src]Struct twilight_embed_builder::footer::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]
fn clone(&self) -> EmbedFooterBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn eq(&self, other: &EmbedFooterBuilder) -> bool
[src]
fn ne(&self, other: &EmbedFooterBuilder) -> bool
[src]
impl StructuralEq for EmbedFooterBuilder
[src]
impl StructuralPartialEq for EmbedFooterBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for EmbedFooterBuilder
impl Send for EmbedFooterBuilder
impl Sync for EmbedFooterBuilder
impl Unpin for EmbedFooterBuilder
impl UnwindSafe for EmbedFooterBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,