Trait Styled

Source
pub trait Styled {
    // Required method
    fn style(&self, style: impl IntoAnsi) -> String;
}
Expand description

Trait used to add a style “extension method” to any type that implements Display as a convenience to call style_text.

Required Methods§

Source

fn style(&self, style: impl IntoAnsi) -> String

Style this value using the given style.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Styled for T
where T: Display,