rust/library/std/src/io
bors 8154955321 Auto merge of #98033 - joshtriplett:is-terminal-fd-handle, r=thomcc
Add `IsTerminal` trait to determine if a descriptor or handle is a terminal

The UNIX implementation uses `isatty`. The Windows implementation uses
the same logic the `atty` crate uses, including the hack needed to
detect msys terminals.

Implement this trait for `Stdin`/`Stdout`/`Stderr`/`File` on all
platforms. On Unix, implement it for `BorrowedFd`/`OwnedFd`. On Windows,
implement it for `BorrowedHandle`/`OwnedHandle`.

Based on https://github.com/rust-lang/rust/pull/91121

Co-authored-by: Matt Wilkinson <mattwilki17@gmail.com>
2022-10-15 01:42:28 +00:00
..
buffered Avoid defensive re-initialization of the BufReader buffer 2022-10-06 23:31:57 -04:00
cursor attempt to optimise vectored write 2022-06-26 17:15:31 +01:00
error fix small word dupe typos 2022-10-13 00:53:46 +08:00
impls std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
readbuf Address reviewer comments 2022-08-18 10:34:40 +01:00
stdio Make default stdio lock() return 'static handles 2022-02-13 10:23:16 -05:00
util non-linux platforms 2022-08-05 17:18:51 +01:00
copy.rs Address reviewer comments 2022-08-18 10:34:40 +01:00
cursor.rs Address reviewer comments 2022-08-18 10:34:40 +01:00
error.rs Rollup merge of #103067 - Nilstrieb:tidy-likes-the-alphabet, r=jackh726 2022-10-14 23:43:46 +02:00
impls.rs Address reviewer comments 2022-08-18 10:34:40 +01:00
mod.rs Add IsTerminal trait to determine if a descriptor or handle is a terminal 2022-10-15 00:35:38 +01:00
prelude.rs Use heading for std::prelude and not io::prelude 2021-01-05 17:52:24 -08:00
readbuf.rs use memset to initialize a readbuf 2022-10-08 14:40:19 +02:00
stdio.rs Add IsTerminal trait to determine if a descriptor or handle is a terminal 2022-10-15 00:35:38 +01:00
tests.rs Rollup merge of #97015 - nrc:read-buf-cursor, r=Mark-Simulacrum 2022-08-28 09:35:11 +02:00
util.rs Address reviewer comments 2022-08-18 10:34:40 +01:00