pub struct Emoji<'a>(pub &'a str, pub &'a str);
Expand description
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.
Tuple Fields§
§0: &'a str
§1: &'a str
Implementations§
Trait Implementations§
impl<'a> Copy for Emoji<'a>
impl<'a> Eq for Emoji<'a>
impl<'a> StructuralPartialEq for Emoji<'a>
Auto Trait Implementations§
impl<'a> Freeze for Emoji<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more