is_terminal

Trait IsTerminal

Source
pub trait IsTerminal {
    // Required method
    fn is_terminal(&self) -> bool;
}
Expand description

Extension trait to check whether something is a terminal.

Required Methods§

Source

fn is_terminal(&self) -> bool

Returns true if this is a terminal.

§Example
use is_terminal::IsTerminal;

if std::io::stdout().is_terminal() {
    println!("stdout is a terminal")
}

Implementors§

Source§

impl<Stream: AsFd> IsTerminal for Stream