Skip to main content

Decorate

Trait Decorate 

Source
pub trait Decorate: ToString {
    // Required methods
    fn underline(&self, underline_character: char) -> String;
    fn overline(&self, overline_character: char) -> String;
    fn outline(
        &self,
        overline_character: char,
        underline_character: char,
    ) -> String;
    fn border(&self, line_character: char, side_character: char) -> String;
}
Expand description

The Decorate trait exposes methods for decorating text with underlines, overlines and outlines

By default, the Decorate trait methods are automatically implemented for the String type

Required Methods§

Source

fn underline(&self, underline_character: char) -> String

Render the string with an underline on the next line using the specific character

Source

fn overline(&self, overline_character: char) -> String

Render the string with an overline on the previous line using the specific character

Source

fn outline(&self, overline_character: char, underline_character: char) -> String

Render the string with both an over- and under-line on the previous and following lines using the specific characters

Source

fn border(&self, line_character: char, side_character: char) -> String

Render the string with a complete border around it

Implementations on Foreign Types§

Source§

impl Decorate for String

Source§

fn underline(&self, underline_character: char) -> String

Source§

fn overline(&self, overline_character: char) -> String

Source§

fn outline(&self, overline_character: char, underline_character: char) -> String

Source§

fn border(&self, line_character: char, side_character: char) -> String

Implementors§