Struct colored::control::ShouldColorize
source · pub struct ShouldColorize { /* private fields */ }
Implementations
sourceimpl ShouldColorize
impl ShouldColorize
sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Reads environment variables to determine whether colorization should
be used or not. CLICOLOR_FORCE
takes highest priority, followed by
NO_COLOR
, followed by CLICOLOR
. In the absence of manual overrides,
which take precedence over all environment variables, the priority
of these variables can be expressed as follows.
NO_COLOR | CLICOLOR | CLICOLOR_FORCE | colorize? |
---|---|---|---|
unset | unset | unset | true (default) |
unset | != 0 | unset | true |
unset | == 0 | unset | false |
set | unset/== 0 /!= 0 | unset | false |
set/unset | unset/== 0 /!= 0 | == 0 | false |
set/unset | unset/== 0 /!= 0 | != 0 | true |
pub fn should_colorize(&self) -> bool
pub fn set_override(&self, override_colorize: bool)
pub fn unset_override(&self)
Trait Implementations
sourceimpl Default for ShouldColorize
impl Default for ShouldColorize
sourcefn default() -> ShouldColorize
fn default() -> ShouldColorize
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ShouldColorize
impl Send for ShouldColorize
impl Sync for ShouldColorize
impl Unpin for ShouldColorize
impl UnwindSafe for ShouldColorize
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more