1 | use crate::IsTerminal; |
2 | |
3 | /// Required functionality for underlying [`std::io::Write`] for adaptation |
4 | #[cfg (not(all(windows, feature = "wincon" )))] |
5 | pub trait RawStream: std::io::Write + IsTerminal + private::Sealed {} |
6 | |
7 | /// Required functionality for underlying [`std::io::Write`] for adaptation |
8 | #[cfg (all(windows, feature = "wincon" ))] |
9 | pub trait RawStream: |
10 | std::io::Write + IsTerminal + anstyle_wincon::WinconStream + private::Sealed |
11 | { |
12 | } |
13 | |
14 | impl RawStream for std::io::Stdout {} |
15 | |
16 | impl RawStream for std::io::StdoutLock<'static> {} |
17 | |
18 | impl RawStream for std::io::Stderr {} |
19 | |
20 | impl RawStream for std::io::StderrLock<'static> {} |
21 | |
22 | impl RawStream for std::fs::File {} |
23 | |
24 | impl RawStream for crate::Buffer {} |
25 | |
26 | mod private { |
27 | pub trait Sealed {} |
28 | |
29 | impl Sealed for std::io::Stdout {} |
30 | |
31 | impl Sealed for std::io::StdoutLock<'static> {} |
32 | |
33 | impl Sealed for std::io::Stderr {} |
34 | |
35 | impl Sealed for std::io::StderrLock<'static> {} |
36 | |
37 | impl Sealed for std::fs::File {} |
38 | |
39 | impl Sealed for crate::Buffer {} |
40 | } |
41 | |