Trait colored::Colorize

source ·
pub trait Colorize {
Show 53 methods // Required methods fn color<S: Into<Color>>(self, color: S) -> ColoredString; fn on_color<S: Into<Color>>(self, color: S) -> ColoredString; fn clear(self) -> ColoredString; fn normal(self) -> ColoredString; fn bold(self) -> ColoredString; fn dimmed(self) -> ColoredString; fn italic(self) -> ColoredString; fn underline(self) -> ColoredString; fn blink(self) -> ColoredString; fn reverse(self) -> ColoredString; fn reversed(self) -> ColoredString; fn hidden(self) -> ColoredString; fn strikethrough(self) -> ColoredString; // Provided methods fn black(self) -> ColoredString where Self: Sized { ... } fn red(self) -> ColoredString where Self: Sized { ... } fn green(self) -> ColoredString where Self: Sized { ... } fn yellow(self) -> ColoredString where Self: Sized { ... } fn blue(self) -> ColoredString where Self: Sized { ... } fn magenta(self) -> ColoredString where Self: Sized { ... } fn purple(self) -> ColoredString where Self: Sized { ... } fn cyan(self) -> ColoredString where Self: Sized { ... } fn white(self) -> ColoredString where Self: Sized { ... } fn bright_black(self) -> ColoredString where Self: Sized { ... } fn bright_red(self) -> ColoredString where Self: Sized { ... } fn bright_green(self) -> ColoredString where Self: Sized { ... } fn bright_yellow(self) -> ColoredString where Self: Sized { ... } fn bright_blue(self) -> ColoredString where Self: Sized { ... } fn bright_magenta(self) -> ColoredString where Self: Sized { ... } fn bright_purple(self) -> ColoredString where Self: Sized { ... } fn bright_cyan(self) -> ColoredString where Self: Sized { ... } fn bright_white(self) -> ColoredString where Self: Sized { ... } fn truecolor(self, r: u8, g: u8, b: u8) -> ColoredString where Self: Sized { ... } fn custom_color(self, color: CustomColor) -> ColoredString where Self: Sized { ... } fn on_black(self) -> ColoredString where Self: Sized { ... } fn on_red(self) -> ColoredString where Self: Sized { ... } fn on_green(self) -> ColoredString where Self: Sized { ... } fn on_yellow(self) -> ColoredString where Self: Sized { ... } fn on_blue(self) -> ColoredString where Self: Sized { ... } fn on_magenta(self) -> ColoredString where Self: Sized { ... } fn on_purple(self) -> ColoredString where Self: Sized { ... } fn on_cyan(self) -> ColoredString where Self: Sized { ... } fn on_white(self) -> ColoredString where Self: Sized { ... } fn on_bright_black(self) -> ColoredString where Self: Sized { ... } fn on_bright_red(self) -> ColoredString where Self: Sized { ... } fn on_bright_green(self) -> ColoredString where Self: Sized { ... } fn on_bright_yellow(self) -> ColoredString where Self: Sized { ... } fn on_bright_blue(self) -> ColoredString where Self: Sized { ... } fn on_bright_magenta(self) -> ColoredString where Self: Sized { ... } fn on_bright_purple(self) -> ColoredString where Self: Sized { ... } fn on_bright_cyan(self) -> ColoredString where Self: Sized { ... } fn on_bright_white(self) -> ColoredString where Self: Sized { ... } fn on_truecolor(self, r: u8, g: u8, b: u8) -> ColoredString where Self: Sized { ... } fn on_custom_color(self, color: CustomColor) -> ColoredString where Self: Sized { ... }
}
Expand description

The trait that enables something to be given color.

You can use colored effectively simply by importing this trait and then using its methods on String and &str.

Required Methods§

source

fn color<S: Into<Color>>(self, color: S) -> ColoredString

source

fn on_color<S: Into<Color>>(self, color: S) -> ColoredString

source

fn clear(self) -> ColoredString

source

fn normal(self) -> ColoredString

source

fn bold(self) -> ColoredString

source

fn dimmed(self) -> ColoredString

source

fn italic(self) -> ColoredString

source

fn underline(self) -> ColoredString

source

fn reverse(self) -> ColoredString

👎Deprecated since 1.5.2: Users should use reversed instead
source

fn reversed(self) -> ColoredString

source

fn hidden(self) -> ColoredString

source

fn strikethrough(self) -> ColoredString

Provided Methods§

source

fn black(self) -> ColoredString
where Self: Sized,

source

fn red(self) -> ColoredString
where Self: Sized,

source

fn green(self) -> ColoredString
where Self: Sized,

source

fn yellow(self) -> ColoredString
where Self: Sized,

source

fn blue(self) -> ColoredString
where Self: Sized,

source

fn magenta(self) -> ColoredString
where Self: Sized,

source

fn purple(self) -> ColoredString
where Self: Sized,

source

fn cyan(self) -> ColoredString
where Self: Sized,

source

fn white(self) -> ColoredString
where Self: Sized,

source

fn bright_black(self) -> ColoredString
where Self: Sized,

source

fn bright_red(self) -> ColoredString
where Self: Sized,

source

fn bright_green(self) -> ColoredString
where Self: Sized,

source

fn bright_yellow(self) -> ColoredString
where Self: Sized,

source

fn bright_blue(self) -> ColoredString
where Self: Sized,

source

fn bright_magenta(self) -> ColoredString
where Self: Sized,

source

fn bright_purple(self) -> ColoredString
where Self: Sized,

source

fn bright_cyan(self) -> ColoredString
where Self: Sized,

source

fn bright_white(self) -> ColoredString
where Self: Sized,

source

fn truecolor(self, r: u8, g: u8, b: u8) -> ColoredString
where Self: Sized,

source

fn custom_color(self, color: CustomColor) -> ColoredString
where Self: Sized,

source

fn on_black(self) -> ColoredString
where Self: Sized,

source

fn on_red(self) -> ColoredString
where Self: Sized,

source

fn on_green(self) -> ColoredString
where Self: Sized,

source

fn on_yellow(self) -> ColoredString
where Self: Sized,

source

fn on_blue(self) -> ColoredString
where Self: Sized,

source

fn on_magenta(self) -> ColoredString
where Self: Sized,

source

fn on_purple(self) -> ColoredString
where Self: Sized,

source

fn on_cyan(self) -> ColoredString
where Self: Sized,

source

fn on_white(self) -> ColoredString
where Self: Sized,

source

fn on_bright_black(self) -> ColoredString
where Self: Sized,

source

fn on_bright_red(self) -> ColoredString
where Self: Sized,

source

fn on_bright_green(self) -> ColoredString
where Self: Sized,

source

fn on_bright_yellow(self) -> ColoredString
where Self: Sized,

source

fn on_bright_blue(self) -> ColoredString
where Self: Sized,

source

fn on_bright_magenta(self) -> ColoredString
where Self: Sized,

source

fn on_bright_purple(self) -> ColoredString
where Self: Sized,

source

fn on_bright_cyan(self) -> ColoredString
where Self: Sized,

source

fn on_bright_white(self) -> ColoredString
where Self: Sized,

source

fn on_truecolor(self, r: u8, g: u8, b: u8) -> ColoredString
where Self: Sized,

source

fn on_custom_color(self, color: CustomColor) -> ColoredString
where Self: Sized,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> Colorize for &'a str

source§

fn color<S: Into<Color>>(self, color: S) -> ColoredString

source§

fn on_color<S: Into<Color>>(self, color: S) -> ColoredString

source§

fn clear(self) -> ColoredString

source§

fn normal(self) -> ColoredString

source§

fn bold(self) -> ColoredString

source§

fn dimmed(self) -> ColoredString

source§

fn italic(self) -> ColoredString

source§

fn underline(self) -> ColoredString

source§

fn reverse(self) -> ColoredString

👎Deprecated since 1.5.2: Users should use reversed instead
source§

fn reversed(self) -> ColoredString

source§

fn hidden(self) -> ColoredString

source§

fn strikethrough(self) -> ColoredString

Implementors§