pub struct Style { /* private fields */ }
Expand description

A Stylized text that can be output to a terminal.

Examples

    let s = Style::new(format!("{}, {}!", "Hello", "world"))
                .black()
                .underline()
                .to_string();
    assert_eq!(s, "\x1b[30;4mHello, world!\x1b[0m");

Implementations

Create a new style whose text is the given text.

Apply a bold value to the escape sequence.

Apply a faint value to the escape sequence.

Apply an italic value to the escape sequence.

Apply an underline value to the escape sequence.

Apply a slow blink value to the escape sequence.

Apply a fast blink value to the escape sequence.

Apply a reverse value to the escape sequence.

Apply a conceal value to the escape sequence.

Apply a strikethrough value to the escape sequence.

Apply the foreground color black value to the escape sequence.

Apply the foreground color red value to the escape sequence.

Apply the foreground color green value to the escape sequence.

Apply the foreground color yellow value to the escape sequence.

Apply the foreground color blue value to the escape sequence.

Apply the foreground color magenta value to the escape sequence.

Apply the foreground color cyan value to the escape sequence.

Apply the foreground color white value to the escape sequence.

Apply the foreground color gray value to the escape sequence.

Apply the foreground color bright red value to the escape sequence.

Apply the foreground color bright green value to the escape sequence.

Apply the foreground color bright yellow value to the escape sequence.

Apply the foreground color bright blue value to the escape sequence.

Apply the foreground color bright magenta value to the escape sequence.

Apply the foreground color bright cyan value to the escape sequence.

Apply the foreground color bright white value to the escape sequence.

Apply the background color black value to the escape sequence.

Apply the background color red value to the escape sequence.

Apply the background color green value to the escape sequence.

Apply the background color yellow value to the escape sequence.

Apply the background color blue value to the escape sequence.

Apply the background color magenta value to the escape sequence.

Apply the background color cyan value to the escape sequence.

Apply the background color white value to the escape sequence.

Apply the background color gray value to the escape sequence.

Apply the background color bright red value to the escape sequence.

Apply the background color bright green value to the escape sequence.

Apply the background color bright yellow value to the escape sequence.

Apply the background color bright blue value to the escape sequence.

Apply the background color bright magenta value to the escape sequence.

Apply the background color bright cyan value to the escape sequence.

Apply the background color bright white value to the escape sequence.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.