pub struct ContentStyle {
    pub foreground_color: Option<Color>,
    pub background_color: Option<Color>,
    pub underline_color: Option<Color>,
    pub attributes: Attributes,
}Expand description
The style that can be put on content.
Fields§
§foreground_color: Option<Color>The foreground color.
background_color: Option<Color>The background color.
underline_color: Option<Color>The underline color.
attributes: AttributesList of attributes.
Implementations§
Source§impl ContentStyle
 
impl ContentStyle
Sourcepub fn apply<D: Display>(self, val: D) -> StyledContent<D>
 
pub fn apply<D: Display>(self, val: D) -> StyledContent<D>
Creates a StyledContent by applying the style to the given val.
Sourcepub fn new() -> ContentStyle
 
pub fn new() -> ContentStyle
Creates a new ContentStyle.
Trait Implementations§
Source§impl AsMut<ContentStyle> for ContentStyle
 
impl AsMut<ContentStyle> for ContentStyle
Source§impl<D: Display> AsMut<ContentStyle> for StyledContent<D>
 
impl<D: Display> AsMut<ContentStyle> for StyledContent<D>
Source§fn as_mut(&mut self) -> &mut ContentStyle
 
fn as_mut(&mut self) -> &mut ContentStyle
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<ContentStyle> for ContentStyle
 
impl AsRef<ContentStyle> for ContentStyle
Source§impl<D: Display> AsRef<ContentStyle> for StyledContent<D>
 
impl<D: Display> AsRef<ContentStyle> for StyledContent<D>
Source§fn as_ref(&self) -> &ContentStyle
 
fn as_ref(&self) -> &ContentStyle
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for ContentStyle
 
impl Clone for ContentStyle
Source§fn clone(&self) -> ContentStyle
 
fn clone(&self) -> ContentStyle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for ContentStyle
 
impl Debug for ContentStyle
Source§impl Default for ContentStyle
 
impl Default for ContentStyle
Source§fn default() -> ContentStyle
 
fn default() -> ContentStyle
Returns the “default value” for a type. Read more
Source§impl PartialEq for ContentStyle
 
impl PartialEq for ContentStyle
Source§impl Stylize for ContentStyle
 
impl Stylize for ContentStyle
Source§type Styled = ContentStyle
 
type Styled = ContentStyle
This type with styles applied.
Source§fn underlined(self) -> Self::Styled
 
fn underlined(self) -> Self::Styled
Applies the 
Underlined attribute to the text.Source§fn slow_blink(self) -> Self::Styled
 
fn slow_blink(self) -> Self::Styled
Applies the 
SlowBlink attribute to the text.Source§fn rapid_blink(self) -> Self::Styled
 
fn rapid_blink(self) -> Self::Styled
Applies the 
RapidBlink attribute to the text.Applies the 
Hidden attribute to the text.Source§fn crossed_out(self) -> Self::Styled
 
fn crossed_out(self) -> Self::Styled
Applies the 
CrossedOut attribute to the text.Source§fn underline_black(self) -> Self::Styled
 
fn underline_black(self) -> Self::Styled
Sets the underline color to 
Black.Source§fn on_dark_grey(self) -> Self::Styled
 
fn on_dark_grey(self) -> Self::Styled
Sets the background color to 
DarkGrey.Source§fn underline_dark_grey(self) -> Self::Styled
 
fn underline_dark_grey(self) -> Self::Styled
Sets the underline color to 
DarkGrey.Source§fn underline_red(self) -> Self::Styled
 
fn underline_red(self) -> Self::Styled
Sets the underline color to 
Red.Source§fn on_dark_red(self) -> Self::Styled
 
fn on_dark_red(self) -> Self::Styled
Sets the background color to 
DarkRed.Source§fn underline_dark_red(self) -> Self::Styled
 
fn underline_dark_red(self) -> Self::Styled
Sets the underline color to 
DarkRed.Source§fn underline_green(self) -> Self::Styled
 
fn underline_green(self) -> Self::Styled
Sets the underline color to 
Green.Source§fn dark_green(self) -> Self::Styled
 
fn dark_green(self) -> Self::Styled
Sets the foreground color to 
DarkGreen.Source§fn on_dark_green(self) -> Self::Styled
 
fn on_dark_green(self) -> Self::Styled
Sets the background color to 
DarkGreen.Source§fn underline_dark_green(self) -> Self::Styled
 
fn underline_dark_green(self) -> Self::Styled
Sets the underline color to 
DarkGreen.Source§fn underline_yellow(self) -> Self::Styled
 
fn underline_yellow(self) -> Self::Styled
Sets the underline color to 
Yellow.Source§fn dark_yellow(self) -> Self::Styled
 
fn dark_yellow(self) -> Self::Styled
Sets the foreground color to 
DarkYellow.Source§fn on_dark_yellow(self) -> Self::Styled
 
fn on_dark_yellow(self) -> Self::Styled
Sets the background color to 
DarkYellow.Source§fn underline_dark_yellow(self) -> Self::Styled
 
fn underline_dark_yellow(self) -> Self::Styled
Sets the underline color to 
DarkYellow.Source§fn underline_blue(self) -> Self::Styled
 
fn underline_blue(self) -> Self::Styled
Sets the underline color to 
Blue.Source§fn on_dark_blue(self) -> Self::Styled
 
fn on_dark_blue(self) -> Self::Styled
Sets the background color to 
DarkBlue.Source§fn underline_dark_blue(self) -> Self::Styled
 
fn underline_dark_blue(self) -> Self::Styled
Sets the underline color to 
DarkBlue.Source§fn on_magenta(self) -> Self::Styled
 
fn on_magenta(self) -> Self::Styled
Sets the background color to 
Magenta.Source§fn underline_magenta(self) -> Self::Styled
 
fn underline_magenta(self) -> Self::Styled
Sets the underline color to 
Magenta.Source§fn dark_magenta(self) -> Self::Styled
 
fn dark_magenta(self) -> Self::Styled
Sets the foreground color to 
DarkMagenta.Source§fn on_dark_magenta(self) -> Self::Styled
 
fn on_dark_magenta(self) -> Self::Styled
Sets the background color to 
DarkMagenta.Source§fn underline_dark_magenta(self) -> Self::Styled
 
fn underline_dark_magenta(self) -> Self::Styled
Sets the underline color to 
DarkMagenta.Source§fn underline_cyan(self) -> Self::Styled
 
fn underline_cyan(self) -> Self::Styled
Sets the underline color to 
Cyan.Source§fn on_dark_cyan(self) -> Self::Styled
 
fn on_dark_cyan(self) -> Self::Styled
Sets the background color to 
DarkCyan.Source§fn underline_dark_cyan(self) -> Self::Styled
 
fn underline_dark_cyan(self) -> Self::Styled
Sets the underline color to 
DarkCyan.Source§fn underline_white(self) -> Self::Styled
 
fn underline_white(self) -> Self::Styled
Sets the underline color to 
White.Source§fn underline_grey(self) -> Self::Styled
 
fn underline_grey(self) -> Self::Styled
Sets the underline color to 
Grey.impl Copy for ContentStyle
impl Eq for ContentStyle
impl StructuralPartialEq for ContentStyle
Auto Trait Implementations§
impl Freeze for ContentStyle
impl RefUnwindSafe for ContentStyle
impl Send for ContentStyle
impl Sync for ContentStyle
impl Unpin for ContentStyle
impl UnwindSafe for ContentStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more