#[non_exhaustive]pub enum ColorScheme {
NoColors,
Default,
RegularAndBold,
Red,
Green,
Blue,
White,
}
Expand description
Enum ColorScheme
in use to represent the diagnostic message.
The default one might be a good choice, but for visually impaired people, alternatives must be provided. Furthermore personal preferences shall be addressed.
For the library, it shall be pointed out that ColorScheme::NONE
might be handled by different program logic. This is because
we use method uses_colors
to determine whether colored output
is actually used. And we invoke different methods depending on the answer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl ColorScheme
impl ColorScheme
Sourcepub fn by_name(scheme: &str) -> Option<Self>
pub fn by_name(scheme: &str) -> Option<Self>
Take a name and return the corresponding ColorScheme instance (or None, if unknown)
Sourcepub fn color_choice(&self) -> ColorChoice
pub fn color_choice(&self) -> ColorChoice
Return the ColorChoice for the configured color scheme
Sourcepub fn all_as_slice() -> &'static [ColorScheme]
pub fn all_as_slice() -> &'static [ColorScheme]
Returns the entire list of supported color schemes as a slice
Sourcepub fn op_section(&self, op_name: &str) -> Result<()>
pub fn op_section(&self, op_name: &str) -> Result<()>
represents an operation like ----- hello-world ---------
Sourcepub fn note_label(&self, label: &str) -> Result<()>
pub fn note_label(&self, label: &str) -> Result<()>
represents a note label like NOTE:
in NOTE: recognize this Unicode codepoint
Sourcepub fn error_label(&self, label: &str) -> Result<()>
pub fn error_label(&self, label: &str) -> Result<()>
represents a error label like ERROR:
in ERROR: argument invalid
Sourcepub fn keyword(&self, word: &str) -> Result<()>
pub fn keyword(&self, word: &str) -> Result<()>
represents a keyword like a column header or type name
pub fn outer_wrapper(&self, wrapper: &str) -> Result<()>
pub fn outer_separator(&self, sep: &str) -> Result<()>
pub fn inner_wrapper(&self, wrapper: &str) -> Result<()>
pub fn inner_separator(&self, sep: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for ColorScheme
impl Clone for ColorScheme
Source§fn clone(&self) -> ColorScheme
fn clone(&self) -> ColorScheme
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more