Struct termimad::crossterm::style::ContentStyle
source · pub struct ContentStyle {
pub foreground_color: Option<Color>,
pub background_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.
attributes: Attributes
List of attributes.
Implementations§
source§impl ContentStyle
impl ContentStyle
sourcepub fn apply<D>(self, val: D) -> StyledContent<D>where
D: Display,
pub fn apply<D>(self, val: D) -> StyledContent<D>where
D: Display,
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§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<D> AsMut<ContentStyle> for StyledContent<D>where
D: Display,
impl<D> AsMut<ContentStyle> for StyledContent<D>where
D: Display,
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§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<D> AsRef<ContentStyle> for StyledContent<D>where
D: Display,
impl<D> AsRef<ContentStyle> for StyledContent<D>where
D: Display,
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 copy 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 From<ContentStyle> for CompoundStyle
impl From<ContentStyle> for CompoundStyle
source§fn from(object_style: ContentStyle) -> CompoundStyle
fn from(object_style: ContentStyle) -> CompoundStyle
Converts to this type from the input type.
source§impl PartialEq<ContentStyle> for ContentStyle
impl PartialEq<ContentStyle> for ContentStyle
source§fn eq(&self, other: &ContentStyle) -> bool
fn eq(&self, other: &ContentStyle) -> bool
source§impl Stylize for ContentStyle
impl Stylize for ContentStyle
§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 on_dark_grey(self) -> Self::Styled
fn on_dark_grey(self) -> Self::Styled
Sets the background color to
DarkGrey
.source§fn on_dark_red(self) -> Self::Styled
fn on_dark_red(self) -> Self::Styled
Sets the background color to
DarkRed
.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 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 on_dark_blue(self) -> Self::Styled
fn on_dark_blue(self) -> Self::Styled
Sets the background color to
DarkBlue
.source§fn on_magenta(self) -> Self::Styled
fn on_magenta(self) -> Self::Styled
Sets the background 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 on_dark_cyan(self) -> Self::Styled
fn on_dark_cyan(self) -> Self::Styled
Sets the background color to
DarkCyan
.