Add more documentation about the IsTty trait (#461)

This commit is contained in:
Arne Beer 2020-07-12 12:16:18 +02:00 committed by GitHub
parent 5365bf976c
commit 30b7d99364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,13 @@ use std::os::windows::io::AsRawHandle;
use winapi::um::consoleapi::GetConsoleMode;
/// Adds the `is_tty` method to types that might represent a terminal
///
/// ```rust
/// use std::io::stdout;
/// use crossterm::tty::IsTty;
///
/// let is_tty: bool = stdout().is_tty();
/// ```
pub trait IsTty {
/// Returns true when an instance is a terminal teletype, otherwise false.
fn is_tty(&self) -> bool;