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

Creates a bold ANSIString

Example

use rpf::Styled;

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

Creates an underlined ANSIString

Example

use rpf::Styled;

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

Paints a given string with the color given

Example

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

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

Implementors