Struct TermFeatures

pub struct TermFeatures<'a>(/* private field */);

Gives access to the terminal features.

Implementations

impl TermFeatures<'_>

fn is_attended(&self) -> bool

Check if this is a real user attended terminal (isatty)

fn colors_supported(&self) -> bool

Check if colors are supported by this terminal.

This does not check if colors are enabled. Currently all terminals are considered to support colors

fn true_colors_supported(&self) -> bool

Check if true colors are supported by this terminal.

fn is_msys_tty(&self) -> bool

Check if this terminal is an msys terminal.

This is sometimes useful to disable features that are known to not work on msys terminals or require special handling.

fn wants_emoji(&self) -> bool

Check if this terminal wants emojis.

fn family(&self) -> TermFamily

Return the family of the terminal.

Trait Implementations

impl<'a> Clone for TermFeatures<'a>

fn clone(&self) -> Self

impl<'a> Debug for TermFeatures<'a>

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

Auto Trait Implementations

impl<'a> Freeze for TermFeatures<'a>

impl<'a> RefUnwindSafe for TermFeatures<'a>

impl<'a> Send for TermFeatures<'a>

impl<'a> Sync for TermFeatures<'a>

impl<'a> Unpin for TermFeatures<'a>

impl<'a> UnsafeUnpin for TermFeatures<'a>

impl<'a> UnwindSafe for TermFeatures<'a>

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for TermFeatures<'a>

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for TermFeatures<'a> 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 TermFeatures<'a> where U: Into<T>,

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

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

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