Struct Emoji

pub struct Emoji<'a, 'b>(pub &'a str, pub &'b str);

"Intelligent" emoji formatter.

This struct intelligently wraps an emoji so that it is rendered only on systems that want emojis and renders a fallback on others.

Example:

use console::Emoji;
println!("[3/4] {}Downloading ...", Emoji("🚚 ", ""));
println!("[4/4] {} Done!", Emoji("✨", ":-)"));

Fields

0: &'a str
1: &'b str

Implementations

impl<'a, 'b> Emoji<'a, 'b>

fn new(emoji: &'a str, fallback: &'b str) -> Emoji<'a, 'b>

Trait Implementations

impl Display for Emoji<'_, '_>

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

impl<'a, 'b> Clone for Emoji<'a, 'b>

fn clone(&self) -> Self

impl<'a, 'b> Copy for Emoji<'a, 'b>

Auto Trait Implementations

impl<'a, 'b> Freeze for Emoji<'a, 'b>

impl<'a, 'b> RefUnwindSafe for Emoji<'a, 'b>

impl<'a, 'b> Send for Emoji<'a, 'b>

impl<'a, 'b> Sync for Emoji<'a, 'b>

impl<'a, 'b> Unpin for Emoji<'a, 'b>

impl<'a, 'b> UnsafeUnpin for Emoji<'a, 'b>

impl<'a, 'b> UnwindSafe for Emoji<'a, 'b>

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Emoji<'a, 'b> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Emoji<'a, 'b> where T: ?Sized,

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

impl<T> CloneToUninit for Emoji<'a, 'b> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Emoji<'a, 'b>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Emoji<'a, 'b> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for Emoji<'a, 'b> where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for Emoji<'a, 'b> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for Emoji<'a, 'b> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Emoji<'a, 'b> where U: TryFrom<T>,

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