is_terminal

Function is_terminal

Source
pub fn is_terminal<T: IsTerminal>(this: T) -> bool
Expand description

Returns true if this is a terminal.

This is equivalent to calling this.is_terminal() and exists only as a convenience to calling the trait method IsTerminal::is_terminal without importing the trait.

ยงExample

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