Fmt

Trait Fmt 

Source
pub trait Fmt: Sized {
    // Provided methods
    fn fg<C>(self, color: C) -> Foreground<Self>
       where C: Into<Option<Color>>,
             Self: Display { ... }
    fn bg<C>(self, color: C) -> Background<Self>
       where C: Into<Option<Color>>,
             Self: Display { ... }
    fn bold(self, bold: bool) -> Bold<Self>
       where Self: Display { ... }
}
Expand description

A trait used to add formatting attributes to displayable items.

If using the concolor feature, this trait assumes that the items are going to be printed to stderr. If you are printing to stdout, use the [StdoutFmt] trait instead.

Attributes specified through this trait are not composable (i.e: the behaviour of two nested attributes each with a conflicting attribute is left unspecified).

Provided Methods§

Source

fn fg<C>(self, color: C) -> Foreground<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified foreground colour.

Source

fn bg<C>(self, color: C) -> Background<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified background colour.

Source

fn bold(self, bold: bool) -> Bold<Self>
where Self: Display,

Make this value bold.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Fmt for T
where T: Display,