Struct text_style::StyledString [−][src]
Expand description
An owned string with an optional style annotation.
Example
let s = format!("Some number: {}", 42); let s0 = text_style::StyledString::plain(s.clone()).bold(); let s1 = text_style::StyledString::styled(s.clone(), text_style::Style::fg(text_style::AnsiColor::Red.dark())); let s2 = text_style::StyledString::plain(s.clone()).with(text_style::AnsiColor::Red.dark()); assert_eq!(s1, s2);
Fields
s: String
The content of this string.
style: Option<Style>
The style of this string.
Implementations
Creates a new styled string from the given string and an optional style.
Creates a new styled string from the given string and style.
Creates a new styled string from the given string and style.
Sets the strikethrough effect for this styled string.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Convert this string into a TermionStr
that can be formatted with termion
. Read more
Auto Trait Implementations
impl RefUnwindSafe for StyledString
impl Send for StyledString
impl Sync for StyledString
impl Unpin for StyledString
impl UnwindSafe for StyledString
Blanket Implementations
Mutably borrows from an owned value. Read more
Calls the given closure and return the result. Read more
Calls the given closure on self
.