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§

source

fn color_kind(self) -> ColorKind

The color kind of this Color

used to detect wether to color on a given terminal

source

fn fmt_foreground_args(self, f: &mut Formatter<'_>) -> Result

write the foreground color arguments

source

fn fmt_background_args(self, f: &mut Formatter<'_>) -> Result

write the background color arguments

source

fn fmt_underline_args(self, f: &mut Formatter<'_>) -> Result

write the underline color arguments

Provided Methods§

source

fn fmt_foreground(self, f: &mut Formatter<'_>) -> Result

write the foreground color sequence

source

fn fmt_background(self, f: &mut Formatter<'_>) -> Result

write the background color sequence

source

fn fmt_underline(self, f: &mut Formatter<'_>) -> Result

write the underline color sequence

Implementations on Foreign Types§

source§

impl WriteColor for Infallible

Implementors§