colored

Trait 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<T>(self, color: T) -> ColoredString where Self: Sized, T: Into<CustomColor> { ... } 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<T>(self, color: T) -> ColoredString where Self: Sized, T: Into<CustomColor> { ... }
}
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<T>(self, color: T) -> ColoredString
where Self: Sized, T: Into<CustomColor>,

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<T>(self, color: T) -> ColoredString
where Self: Sized, T: Into<CustomColor>,

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.

Implementations on Foreign Types§

Source§

impl Colorize for &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§