Trait crossterm::style::Stylize [−][src]
pub trait Stylize: Sized { type Styled: AsRef<ContentStyle> + AsMut<ContentStyle>;}Show methods
fn stylize(self) -> Self::Styled; fn with(self, color: Color) -> Self::Styled { ... } fn on(self, color: Color) -> Self::Styled { ... } fn attribute(self, attr: Attribute) -> Self::Styled { ... } fn reset(self) -> Self::Styled { ... } fn bold(self) -> Self::Styled { ... } fn underlined(self) -> Self::Styled { ... } fn reverse(self) -> Self::Styled { ... } fn dim(self) -> Self::Styled { ... } fn italic(self) -> Self::Styled { ... } fn negative(self) -> Self::Styled { ... } fn slow_blink(self) -> Self::Styled { ... } fn rapid_blink(self) -> Self::Styled { ... } fn hidden(self) -> Self::Styled { ... } fn crossed_out(self) -> Self::Styled { ... } fn black(self) -> Self::Styled { ... } fn on_black(self) -> Self::Styled { ... } fn dark_grey(self) -> Self::Styled { ... } fn on_dark_grey(self) -> Self::Styled { ... } fn red(self) -> Self::Styled { ... } fn on_red(self) -> Self::Styled { ... } fn dark_red(self) -> Self::Styled { ... } fn on_dark_red(self) -> Self::Styled { ... } fn green(self) -> Self::Styled { ... } fn on_green(self) -> Self::Styled { ... } fn dark_green(self) -> Self::Styled { ... } fn on_dark_green(self) -> Self::Styled { ... } fn yellow(self) -> Self::Styled { ... } fn on_yellow(self) -> Self::Styled { ... } fn dark_yellow(self) -> Self::Styled { ... } fn on_dark_yellow(self) -> Self::Styled { ... } fn blue(self) -> Self::Styled { ... } fn on_blue(self) -> Self::Styled { ... } fn dark_blue(self) -> Self::Styled { ... } fn on_dark_blue(self) -> Self::Styled { ... } fn magenta(self) -> Self::Styled { ... } fn on_magenta(self) -> Self::Styled { ... } fn dark_magenta(self) -> Self::Styled { ... } fn on_dark_magenta(self) -> Self::Styled { ... } fn cyan(self) -> Self::Styled { ... } fn on_cyan(self) -> Self::Styled { ... } fn dark_cyan(self) -> Self::Styled { ... } fn on_dark_cyan(self) -> Self::Styled { ... } fn white(self) -> Self::Styled { ... } fn on_white(self) -> Self::Styled { ... } fn grey(self) -> Self::Styled { ... } fn on_grey(self) -> Self::Styled { ... }
Expand description
Provides a set of methods to set attributes and colors.
Examples
use crossterm::style::Stylize; println!("{}", "Bold text".bold()); println!("{}", "Underlined text".underlined()); println!("{}", "Negative text".negative()); println!("{}", "Red on blue".red().on_blue());
Associated Types
type Styled: AsRef<ContentStyle> + AsMut<ContentStyle>
[src]
type Styled: AsRef<ContentStyle> + AsMut<ContentStyle>
[src]This type with styles applied.
Required methods
Provided methods
fn underlined(self) -> Self::Styled
[src]
fn underlined(self) -> Self::Styled
[src]Applies the Underlined
attribute to the text.
fn slow_blink(self) -> Self::Styled
[src]
fn slow_blink(self) -> Self::Styled
[src]Applies the SlowBlink
attribute to the text.
fn rapid_blink(self) -> Self::Styled
[src]
fn rapid_blink(self) -> Self::Styled
[src]Applies the RapidBlink
attribute to the text.
Applies the Hidden
attribute to the text.
fn crossed_out(self) -> Self::Styled
[src]
fn crossed_out(self) -> Self::Styled
[src]Applies the CrossedOut
attribute to the text.
fn on_dark_grey(self) -> Self::Styled
[src]
fn on_dark_grey(self) -> Self::Styled
[src]Sets the background color to DarkGrey
.
fn on_dark_red(self) -> Self::Styled
[src]
fn on_dark_red(self) -> Self::Styled
[src]Sets the background color to DarkRed
.
fn dark_green(self) -> Self::Styled
[src]
fn dark_green(self) -> Self::Styled
[src]Sets the foreground color to DarkGreen
.
fn on_dark_green(self) -> Self::Styled
[src]
fn on_dark_green(self) -> Self::Styled
[src]Sets the background color to DarkGreen
.
fn dark_yellow(self) -> Self::Styled
[src]
fn dark_yellow(self) -> Self::Styled
[src]Sets the foreground color to DarkYellow
.
fn on_dark_yellow(self) -> Self::Styled
[src]
fn on_dark_yellow(self) -> Self::Styled
[src]Sets the background color to DarkYellow
.
fn on_dark_blue(self) -> Self::Styled
[src]
fn on_dark_blue(self) -> Self::Styled
[src]Sets the background color to DarkBlue
.
fn on_magenta(self) -> Self::Styled
[src]
fn on_magenta(self) -> Self::Styled
[src]Sets the background color to Magenta
.
fn dark_magenta(self) -> Self::Styled
[src]
fn dark_magenta(self) -> Self::Styled
[src]Sets the foreground color to DarkMagenta
.
fn on_dark_magenta(self) -> Self::Styled
[src]
fn on_dark_magenta(self) -> Self::Styled
[src]Sets the background color to DarkMagenta
.
fn on_dark_cyan(self) -> Self::Styled
[src]
fn on_dark_cyan(self) -> Self::Styled
[src]Sets the background color to DarkCyan
.