Trait term_painter::ToStyle [] [src]

pub trait ToStyle: Sized {
    fn to_style(self) -> Style;

    fn to_mapped_style<F>(self, func: F) -> Style
    where
        F: FnOnce(&mut Style)
, { ... } fn fg(self, c: Color) -> Style { ... } fn bg(self, c: Color) -> Style { ... } fn bold(self) -> Style { ... } fn dim(self) -> Style { ... } fn underline(self) -> Style { ... } fn not_underline(self) -> Style { ... } fn blink(self) -> Style { ... } fn reverse(self) -> Style { ... } fn secure(self) -> Style { ... } fn paint<T>(&self, obj: T) -> Painted<T>
    where
        Self: Clone
, { ... } fn with<F, R>(&self, f: F) -> R
    where
        F: FnOnce() -> R,
        Self: Clone
, { ... } }

Everything that can be seen as part of a style. This is the core of this crate. All functions ("style modifier") consume self and return a modified version of the style.

Required Methods

Provided Methods

Convenience method for modifying the style before it's returned.

Sets the foreground (text) color.

Sets the background color.

Makes the text bold.

Dim mode.

Underlines the text.

Removes underline-attribute.

Underlines the text.

Underlines the text.

Secure mode.

Wraps the style specified in self and something of arbitrary type into a Painted. When Painted is printed it will print the arbitrary something with the given style.

Executes the given function, applying the style information before calling it and resetting after it finished.

Implementors