From 30b7d9936449fa1f16005a0bbb119b174dc11f90 Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Sun, 12 Jul 2020 12:16:18 +0200 Subject: [PATCH] Add more documentation about the IsTty trait (#461) --- src/tty.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tty.rs b/src/tty.rs index 4bfabb2f..69723651 100644 --- a/src/tty.rs +++ b/src/tty.rs @@ -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;