Trait rpf::Styled [] [src]

pub trait Styled {
    fn bold(&self) -> ANSIString;
    fn underline(&self) -> ANSIString;
    fn paint(&self, color: Color) -> ANSIString;
}

Trait for creating stylized console printing using ansi_term

Required Methods

fn bold(&self) -> ANSIString

Creates a bold ANSIString

Example

use rpf::Styled;

let styled = "Styled string test".bold();
println!("{}", styled);

fn underline(&self) -> ANSIString

Creates an underlined ANSIString

Example

use rpf::Styled;

let styled = "Styled string test".underline();
println!("{}", styled);

fn paint(&self, color: Color) -> ANSIString

Paints a given string with the color given

Example

use rpf::Styled;
use rpf::Color;

let painted = "Styled string test".paint(Color::Yellow);
println!("{}", painted);

Implementors