twitch_types::emote

Struct EmoteUrlBuilder

Source
pub struct EmoteUrlBuilder<'a> { /* private fields */ }
Available on crate feature emote only.
Expand description

Builder for emote URLs.

§Examples

let emote_id = EmoteId::from("emotesv2_dc24652ada1e4c84a5e3ceebae4de709");
assert_eq!(emote_id.url().size_3x().dark_mode().render(), "https://static-cdn.jtvnw.net/emoticons/v2/emotesv2_dc24652ada1e4c84a5e3ceebae4de709/default/dark/3.0")

Implementations§

Source§

impl EmoteUrlBuilder<'_>

Source

pub fn new(id: &EmoteIdRef) -> EmoteUrlBuilder<'_>

Construct a new EmoteUrlBuilder from a EmoteId

Defaults to 1.0 scale, default animation and light theme.

Source

pub fn size_1x(self) -> Self

Set size to 1.0

Source

pub fn size_2x(self) -> Self

Set size to 2.0

Source

pub fn size_3x(self) -> Self

Set size to 3.0

Source

pub fn dark_mode(self) -> Self

Set theme to dark mode

Source

pub fn light_mode(self) -> Self

Set theme to light mode

Source

pub fn animation_default(self) -> Self

Set animation mode to default

Source

pub fn animation_static(self) -> Self

Set animation mode to static

Source

pub fn animation_animated(self) -> Self

Set animation mode to animate

Source

pub fn render(self) -> String

Create the URL for this emote.

Trait Implementations§

Source§

impl<'a> Clone for EmoteUrlBuilder<'a>

Source§

fn clone(&self) -> EmoteUrlBuilder<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for EmoteUrlBuilder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for EmoteUrlBuilder<'a>

§

impl<'a> RefUnwindSafe for EmoteUrlBuilder<'a>

§

impl<'a> Send for EmoteUrlBuilder<'a>

§

impl<'a> Sync for EmoteUrlBuilder<'a>

§

impl<'a> Unpin for EmoteUrlBuilder<'a>

§

impl<'a> UnwindSafe for EmoteUrlBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.