Trait colorz::WriteColor
source · pub trait WriteColor: Seal {
// Required methods
fn color_kind(self) -> ColorKind;
fn fmt_foreground_args(self, f: &mut Formatter<'_>) -> Result;
fn fmt_background_args(self, f: &mut Formatter<'_>) -> Result;
fn fmt_underline_args(self, f: &mut Formatter<'_>) -> Result;
// Provided methods
fn fmt_foreground(self, f: &mut Formatter<'_>) -> Result { ... }
fn fmt_background(self, f: &mut Formatter<'_>) -> Result { ... }
fn fmt_underline(self, f: &mut Formatter<'_>) -> Result { ... }
}
Expand description
A sealed trait for describing how to write ANSI color args
Required Methods§
sourcefn color_kind(self) -> ColorKind
fn color_kind(self) -> ColorKind
The color kind of this Color
used to detect wether to color on a given terminal
sourcefn fmt_foreground_args(self, f: &mut Formatter<'_>) -> Result
fn fmt_foreground_args(self, f: &mut Formatter<'_>) -> Result
write the foreground color arguments
sourcefn fmt_background_args(self, f: &mut Formatter<'_>) -> Result
fn fmt_background_args(self, f: &mut Formatter<'_>) -> Result
write the background color arguments
sourcefn fmt_underline_args(self, f: &mut Formatter<'_>) -> Result
fn fmt_underline_args(self, f: &mut Formatter<'_>) -> Result
write the underline color arguments
Provided Methods§
sourcefn fmt_foreground(self, f: &mut Formatter<'_>) -> Result
fn fmt_foreground(self, f: &mut Formatter<'_>) -> Result
write the foreground color sequence
sourcefn fmt_background(self, f: &mut Formatter<'_>) -> Result
fn fmt_background(self, f: &mut Formatter<'_>) -> Result
write the background color sequence
sourcefn fmt_underline(self, f: &mut Formatter<'_>) -> Result
fn fmt_underline(self, f: &mut Formatter<'_>) -> Result
write the underline color sequence