pub trait Stylize {
type Output;
// Required methods
fn stylize(self) -> Self::Output;
fn with_color(self, color: Color) -> Self::Output;
fn with_attr(self, attribute: Attribute) -> Self::Output;
fn with_color_and_attr(
self,
color: Color,
attribute: Attribute
) -> Self::Output;
}
Expand description
let new = "hello".stylize();
let old = StyledStr::new("hello", None, None);
assert_eq!(new, old);
let new = "hello".to_string().with_color_and_attr(THEME.colors.warning, Attribute::Bold);
let old = StyledString::new("hello", Some(THEME.colors.warning), Some(Attribute::Bold));
assert_eq!(new, old);