ConsoleOutputFeatures

Trait ConsoleOutputFeatures 

Source
pub trait ConsoleOutputFeatures {
    // Required methods
    fn is_atty(&self) -> bool;
    fn enable_ansi(&self) -> bool;
}
Expand description

Describe an arbitrary set of features that are available on an output.

Most outputs should automatically have this implemented, but if you’re using a custom type you may need to implement it yourself.

Required Methods§

Source

fn is_atty(&self) -> bool

If this output is a TTY.

Source

fn enable_ansi(&self) -> bool

Attempt to enable ANSI support, this will return whether or not enabling was successful.

Implementations on Foreign Types§

Source§

impl ConsoleOutputFeatures for &UnixStream

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for &mut [u8]

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for VecDeque<u8>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Arc<File>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Vec<u8>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for File

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Cursor<&mut Vec<u8>>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Cursor<&mut [u8]>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Cursor<Box<[u8]>>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Cursor<Vec<u8>>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for PipeWriter

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Stderr

Source§

fn enable_ansi(&self) -> bool

Only windows terminals have to have ansi ENABLED.

Source§

fn is_atty(&self) -> bool

Source§

impl ConsoleOutputFeatures for StderrLock<'_>

Source§

fn enable_ansi(&self) -> bool

Only windows terminals have to have ansi ENABLED.

Source§

fn is_atty(&self) -> bool

Source§

impl ConsoleOutputFeatures for Stdout

Source§

fn enable_ansi(&self) -> bool

Only windows terminals have to have ansi ENABLED.

Source§

fn is_atty(&self) -> bool

Source§

impl ConsoleOutputFeatures for StdoutLock<'_>

Source§

fn enable_ansi(&self) -> bool

Only windows terminals have to have ansi ENABLED.

Source§

fn is_atty(&self) -> bool

Source§

impl ConsoleOutputFeatures for Empty

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for Sink

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for TcpStream

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl ConsoleOutputFeatures for UnixStream

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl<Inner: ConsoleOutputFeatures + Write> ConsoleOutputFeatures for BufWriter<Inner>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl<Inner: ConsoleOutputFeatures + Write> ConsoleOutputFeatures for LineWriter<Inner>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl<Inner: ConsoleOutputFeatures> ConsoleOutputFeatures for Box<Inner>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Source§

impl<const N: usize> ConsoleOutputFeatures for Cursor<[u8; N]>

Source§

fn is_atty(&self) -> bool

Source§

fn enable_ansi(&self) -> bool

Implementors§