Enum ColorChoice
pub enum ColorChoice
ColorChoice represents the color preferences of an end user.
The Default implementation for this type will select Auto, which tries
to do the right thing based on the current environment.
The FromStr implementation for this type converts a lowercase kebab-case
string of the variant name to the corresponding variant. Any other string
results in an error.
Variants
-
Always Try very hard to emit colors. This includes emitting ANSI colors on Windows if the console API is unavailable.
-
AlwaysAnsi AlwaysAnsi is like Always, except it never tries to use anything other than emitting ANSI color codes.
-
Auto Try to use colors, but don't force the issue. If the console isn't available on Windows, or if TERM=dumb, or if
NO_COLORis defined, for example, then don't use colors.-
Never Never emit colors.
Trait Implementations
impl Clone for ColorChoice
fn clone(&self) -> Self
impl Copy for ColorChoice
impl Debug for ColorChoice
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for ColorChoice
fn default() -> ColorChoice
impl Eq for ColorChoice
impl FromStr for ColorChoice
type Err = ColorChoiceParseError;fn from_str(s: &str) -> Result<ColorChoice, ColorChoiceParseError>
impl PartialEq for ColorChoice
fn eq(&self, other: &Self) -> bool