Trait terminal_io::WriteTerminal 
source · pub trait WriteTerminal: Write + Terminal {
    fn color_support(&self) -> TerminalColorSupport;
    fn color_preference(&self) -> bool;
    fn is_output_terminal(&self) -> bool;
    fn color_default(&self) -> bool { ... }
}Expand description
An extension trait for output streams connected to terminals.
Required Methods§
sourcefn color_support(&self) -> TerminalColorSupport
 
fn color_support(&self) -> TerminalColorSupport
Test whether this output stream supports color control codes.
sourcefn color_preference(&self) -> bool
 
fn color_preference(&self) -> bool
Test whether the user has indicated a preference for color output by
default. Respects the NO_COLOR environment variable where applicable.
sourcefn is_output_terminal(&self) -> bool
 
fn is_output_terminal(&self) -> bool
Test whether the output is connected to a terminal.
Also known as isatty.
Provided Methods§
sourcefn color_default(&self) -> bool
 
fn color_default(&self) -> bool
Test whether color should be used on this terminal by default. This includes both whether color is supported and whether the user has not indicated a preference otherwise.