StyleString

Trait StyleString 

Source
pub trait StyleString {
    // Required method
    fn style(&self) -> StyledString<'_>;

    // Provided method
    fn apply_styles<'content>(
        &'content self,
        styles: &'content StylesContainer,
    ) -> StyledString<'content> { ... }
}
Expand description

A trait meaning it can be converted into a styled string instead

Required Methods§

Source

fn style(&self) -> StyledString<'_>

Converts the current type into a Styled String

Provided Methods§

Source

fn apply_styles<'content>( &'content self, styles: &'content StylesContainer, ) -> StyledString<'content>

Creates a styled string with the applied settings

Implementations on Foreign Types§

Source§

impl StyleString for String

Source§

fn style(&self) -> StyledString<'_>

Source§

impl<'content> StyleString for &'content str

Source§

fn style(&self) -> StyledString<'_>

Source§

impl<'content> StyleString for &'content String

Source§

fn style(&self) -> StyledString<'content>

Implementors§