Trait std::io::IsTerminal
source · [−]pub trait IsTerminal: Sealed {
fn is_terminal(&self) -> bool;
}
🔬This is a nightly-only experimental API. (
is_terminal
#98070)Expand description
Trait to determine if a descriptor/handle refers to a terminal/tty.
Required Methods
sourcefn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
🔬This is a nightly-only experimental API. (
is_terminal
#98070)Returns true
if the descriptor/handle refers to a terminal/tty.
On platforms where Rust does not know how to detect a terminal yet, this will return
false
. This will also return false
if an unexpected error occurred, such as from
passing an invalid file descriptor.
Implementors
impl IsTerminal for File
impl IsTerminal for BorrowedFd<'_>
impl IsTerminal for OwnedFd
impl IsTerminal for BorrowedHandle<'_>
Available on Windows only.
impl IsTerminal for OwnedHandle
Available on Windows only.