1use crate::IsTerminal;
2
3/// Required functionality for underlying [`std::io::Write`] for adaptation
4#[cfg(not(all(windows, feature = "wincon")))]
5pub 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"))]
9pub trait RawStream:
10 std::io::Write + IsTerminal + anstyle_wincon::WinconStream + private::Sealed
11{
12}
13
14impl RawStream for std::io::Stdout {}
15
16impl RawStream for std::io::StdoutLock<'static> {}
17
18impl RawStream for std::io::Stderr {}
19
20impl RawStream for std::io::StderrLock<'static> {}
21
22impl RawStream for std::fs::File {}
23
24impl RawStream for crate::Buffer {}
25
26mod 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