Trait terminal_io::WriteTerminal [−][src]
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
fn color_support(&self) -> TerminalColorSupport[src]
fn color_support(&self) -> TerminalColorSupport[src]Test whether this output stream supports color control codes.
fn color_preference(&self) -> bool[src]
fn color_preference(&self) -> bool[src]Test whether the user has indicated a preference for color output by
default. Respects the NO_COLOR environment variable where applicable.
fn is_output_terminal(&self) -> bool[src]
fn is_output_terminal(&self) -> bool[src]Test whether the output is connected to a terminal.
Also known as isatty.
Provided methods
fn color_default(&self) -> bool[src]
fn color_default(&self) -> bool[src]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.
Implementors
impl<Inner: Write> WriteTerminal for NeverTerminalWriter<Inner>[src]
impl<Inner: Write> WriteTerminal for NeverTerminalWriter<Inner>[src]fn color_support(&self) -> TerminalColorSupport[src]
fn color_preference(&self) -> bool[src]
fn is_output_terminal(&self) -> bool[src]
impl<Inner: Write> WriteTerminal for TerminalWriter<Inner>[src]
impl<Inner: Write> WriteTerminal for TerminalWriter<Inner>[src]fn color_support(&self) -> TerminalColorSupport[src]
fn color_preference(&self) -> bool[src]
fn is_output_terminal(&self) -> bool[src]
impl<Inner: Duplex + Read + Write> WriteTerminal for TerminalDuplexer<Inner>[src]
impl<Inner: Duplex + Read + Write> WriteTerminal for TerminalDuplexer<Inner>[src]fn color_support(&self) -> TerminalColorSupport[src]
fn color_preference(&self) -> bool[src]
fn is_output_terminal(&self) -> bool[src]
impl<Inner: Duplex + Write> WriteTerminal for NeverTerminalDuplexer<Inner>[src]
impl<Inner: Duplex + Write> WriteTerminal for NeverTerminalDuplexer<Inner>[src]