Struct crossterm::style::ContentStyle
source · 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: Attributes
List 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 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 PartialEq for ContentStyle
impl PartialEq for ContentStyle
source§fn eq(&self, other: &ContentStyle) -> bool
fn eq(&self, other: &ContentStyle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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 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