Skip to main content

TextExt

Trait TextExt 

Source
pub trait TextExt {
    // Required methods
    fn bold(&self) -> Text<'_>;
    fn italic(&self) -> Text<'_>;
    fn strike(&self) -> Text<'_>;
    fn monospace(&self) -> Text<'_>;
    fn secret(&self) -> Text<'_>;
    fn red(&self) -> Text<'_>;
    fn green(&self) -> Text<'_>;
    fn blue(&self) -> Text<'_>;
    fn yellow(&self) -> Text<'_>;
    fn cyan(&self) -> Text<'_>;
    fn magenta(&self) -> Text<'_>;
}
Expand description

An extension trait supposed to construct Text types from string like types, e.g.

format!("Hello, {}", user_name.bold())

Required Methods§

Source

fn bold(&self) -> Text<'_>

Source

fn italic(&self) -> Text<'_>

Source

fn strike(&self) -> Text<'_>

Source

fn monospace(&self) -> Text<'_>

Source

fn secret(&self) -> Text<'_>

Source

fn red(&self) -> Text<'_>

Source

fn green(&self) -> Text<'_>

Source

fn blue(&self) -> Text<'_>

Source

fn yellow(&self) -> Text<'_>

Source

fn cyan(&self) -> Text<'_>

Source

fn magenta(&self) -> Text<'_>

Implementors§

Source§

impl<S> TextExt for S
where S: Deref<Target = str>,