Trait Colored

Source
pub trait Colored: Display {
Show 24 methods // Provided methods fn bold(&self) -> String { ... } fn underline(&self) -> String { ... } fn italic(&self) -> String { ... } fn reverse(&self) -> String { ... } fn delete(&self) -> String { ... } fn black(&self) -> String { ... } fn red(&self) -> String { ... } fn green(&self) -> String { ... } fn yellow(&self) -> String { ... } fn blue(&self) -> String { ... } fn purple(&self) -> String { ... } fn cyan(&self) -> String { ... } fn grey(&self) -> String { ... } fn bg_black(&self) -> String { ... } fn bg_red(&self) -> String { ... } fn bg_green(&self) -> String { ... } fn bg_yellow(&self) -> String { ... } fn bg_blue(&self) -> String { ... } fn bg_purple(&self) -> String { ... } fn bg_cyan(&self) -> String { ... } fn bg_grey(&self) -> String { ... } fn color(&self, r: u8, g: u8, b: u8) -> String { ... } fn bg_color(&self, r: u8, g: u8, b: u8) -> String { ... } fn fonts(&self, fonts: String) -> String { ... }
}

Provided Methods§

Source

fn bold(&self) -> String

Source

fn underline(&self) -> String

Source

fn italic(&self) -> String

Source

fn reverse(&self) -> String

Source

fn delete(&self) -> String

Source

fn black(&self) -> String

Source

fn red(&self) -> String

Source

fn green(&self) -> String

Source

fn yellow(&self) -> String

Source

fn blue(&self) -> String

Source

fn purple(&self) -> String

Source

fn cyan(&self) -> String

Source

fn grey(&self) -> String

Source

fn bg_black(&self) -> String

Source

fn bg_red(&self) -> String

Source

fn bg_green(&self) -> String

Source

fn bg_yellow(&self) -> String

Source

fn bg_blue(&self) -> String

Source

fn bg_purple(&self) -> String

Source

fn bg_cyan(&self) -> String

Source

fn bg_grey(&self) -> String

Source

fn color(&self, r: u8, g: u8, b: u8) -> String

Source

fn bg_color(&self, r: u8, g: u8, b: u8) -> String

Source

fn fonts(&self, fonts: String) -> String

§Examples
println!("{}","test".fonts("\x1b[1;31m"));
println!("{}","test".fonts(fonts!(Font::Bold,Font::Red)));

Implementors§

Source§

impl<T> Colored for T
where T: Display + ?Sized,

为所有实现 Display 的数据实现 Colored