mycelium_trace::color

Trait SetColor

Source
pub trait SetColor {
    // Required methods
    fn set_fg_color(&mut self, color: Color);
    fn fg_color(&self) -> Color;
    fn set_bold(&mut self, bold: bool);

    // Provided methods
    fn with_bold(&mut self) -> WithBold<'_, Self>
       where Self: Write + Sized { ... }
    fn with_fg_color(&mut self, color: Color) -> WithFgColor<'_, Self>
       where Self: Write + Sized { ... }
}

Required Methods§

Source

fn set_fg_color(&mut self, color: Color)

Source

fn fg_color(&self) -> Color

Source

fn set_bold(&mut self, bold: bool)

Sets bold text.

This may brighten a text color if bold text is not supported.

Provided Methods§

Source

fn with_bold(&mut self) -> WithBold<'_, Self>
where Self: Write + Sized,

Source

fn with_fg_color(&mut self, color: Color) -> WithFgColor<'_, Self>
where Self: Write + Sized,

Implementations on Foreign Types§

Source§

impl<W: SetColor> SetColor for &mut W

Source§

fn set_fg_color(&mut self, color: Color)

Source§

fn fg_color(&self) -> Color

Source§

fn set_bold(&mut self, bold: bool)

Implementors§

Source§

impl SetColor for NoWriter

Source§

impl<A, B> SetColor for EitherWriter<A, B>
where A: Write + SetColor, B: Write + SetColor,

Source§

impl<D> SetColor for TextWriter<'_, D>
where D: Draw,

Available on crate feature embedded-graphics only.
Source§

impl<W: Write> SetColor for AnsiEscapes<W>