Struct terminal_emoji::Emoji [−][src]
An emoji with safety fallback.
The struct wraps an emoji and only renders it on platforms that actually support it. On non-supported platforms the fallback value is being rendered.
Support is determined by two factors:
- The processes stdout has to be a tty.
- Platform dependent:
- macOS has emoji support by default
- Unix systems have support if the active language supports them.
- Windows machines running the new Terminal app support emojis.
Implementations
impl<'a> Emoji<'a>
[src]
pub const fn new(emoji: &'a str, fallback: &'a str) -> Self
[src]
Create a new emoji.
Arguments
emoji
: The unicode emoji to display.fallback
: The fallback value to use on non-supported platforms.
Trait Implementations
impl<'a> Clone for Emoji<'a>
[src]
impl<'a> Copy for Emoji<'a>
[src]
impl<'a> Debug for Emoji<'a>
[src]
impl Display for Emoji<'_>
[src]
impl<'a> Eq for Emoji<'a>
[src]
impl<'a> From<(&'a str, &'a str)> for Emoji<'a>
[src]
impl<'a> Hash for Emoji<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> PartialEq<Emoji<'a>> for Emoji<'a>
[src]
impl<'a> StructuralEq for Emoji<'a>
[src]
impl<'a> StructuralPartialEq for Emoji<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Emoji<'a>
impl<'a> Send for Emoji<'a>
impl<'a> Sync for Emoji<'a>
impl<'a> Unpin for Emoji<'a>
impl<'a> UnwindSafe for Emoji<'a>
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,