pub enum Depth {
None,
Ansi16,
Ansi256,
TrueColor,
}Expand description
How many colors a terminal shows. Ordered: a deeper terminal shows everything a shallower one does.
Variants§
None
No color and no attributes: a pipe, a file, NO_COLOR.
Ansi16
The 16 basic colors, bold, underline: every color terminal.
Ansi256
The xterm 256-color palette: TERM=*-256color.
TrueColor
24-bit color: COLORTERM=truecolor.
Implementations§
Source§impl Depth
impl Depth
Sourcepub fn detect(is_terminal: bool) -> Depth
pub fn detect(is_terminal: bool) -> Depth
The depth for a stream that is (or is not) a terminal, from the environment:
- a non-empty
NO_COLORmeans none, and it wins overFORCE_COLOR; FORCE_COLOR=0orfalsemeans none too;FORCE_COLOR(1–3, or empty/truefor 1) is a minimum depth, not the depth: a terminal that can show more still does.CLICOLOR_FORCE(not0) gives color even to a pipe;- otherwise none for a pipe,
CLICOLOR=0,TERM=dumb, or noTERMat all; - then 24-bit for
COLORTERM=truecolor/24bit, aTERMending indirectortruecolor, or iTerm2; 256 for aTERMending in256/256coloror Apple’s Terminal; else 16.
Under with_env the stream never counts as a
terminal, so the answer depends only on the variables given.
Trait Implementations§
impl Copy for Depth
impl Eq for Depth
Source§impl Ord for Depth
impl Ord for Depth
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Depth
impl PartialOrd for Depth
impl StructuralPartialEq for Depth
Auto Trait Implementations§
impl Freeze for Depth
impl RefUnwindSafe for Depth
impl Send for Depth
impl Sync for Depth
impl Unpin for Depth
impl UnsafeUnpin for Depth
impl UnwindSafe for Depth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more