pub struct Style {
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
sourceimpl 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
sourceimpl AsMut<ContentStyle> for ContentStyle
impl AsMut<ContentStyle> for ContentStyle
sourcefn 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.
sourceimpl AsRef<ContentStyle> for ContentStyle
impl AsRef<ContentStyle> for ContentStyle
sourcefn as_ref(&self) -> &ContentStyle
fn as_ref(&self) -> &ContentStyle
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Clone for ContentStyle
impl Clone for ContentStyle
sourcefn clone(&self) -> ContentStyle
fn clone(&self) -> ContentStyle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ContentStyle
impl Debug for ContentStyle
sourceimpl Default for ContentStyle
impl Default for ContentStyle
sourcefn default() -> ContentStyle
fn default() -> ContentStyle
Returns the “default value” for a type. Read more
sourceimpl PartialEq<ContentStyle> for ContentStyle
impl PartialEq<ContentStyle> for ContentStyle
sourcefn eq(&self, other: &ContentStyle) -> bool
fn eq(&self, other: &ContentStyle) -> bool
sourceimpl Stylize for ContentStyle
impl Stylize for ContentStyle
type Styled = ContentStyle
type Styled = ContentStyle
This type with styles applied.
sourcefn stylize(self) -> <ContentStyle as Stylize>::Styled
fn stylize(self) -> <ContentStyle as Stylize>::Styled
Styles this type.
sourcefn underlined(self) -> Self::Styled
fn underlined(self) -> Self::Styled
Applies the
Underlined
attribute to the text.sourcefn slow_blink(self) -> Self::Styled
fn slow_blink(self) -> Self::Styled
Applies the
SlowBlink
attribute to the text.sourcefn 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.sourcefn crossed_out(self) -> Self::Styled
fn crossed_out(self) -> Self::Styled
Applies the
CrossedOut
attribute to the text.sourcefn underline_black(self) -> Self::Styled
fn underline_black(self) -> Self::Styled
Sets the underline color to
Black
.sourcefn on_dark_grey(self) -> Self::Styled
fn on_dark_grey(self) -> Self::Styled
Sets the background color to
DarkGrey
.sourcefn underline_dark_grey(self) -> Self::Styled
fn underline_dark_grey(self) -> Self::Styled
Sets the underline color to
DarkGrey
.sourcefn underline_red(self) -> Self::Styled
fn underline_red(self) -> Self::Styled
Sets the underline color to
Red
.sourcefn on_dark_red(self) -> Self::Styled
fn on_dark_red(self) -> Self::Styled
Sets the background color to
DarkRed
.sourcefn underline_dark_red(self) -> Self::Styled
fn underline_dark_red(self) -> Self::Styled
Sets the underline color to
DarkRed
.sourcefn underline_green(self) -> Self::Styled
fn underline_green(self) -> Self::Styled
Sets the underline color to
Green
.sourcefn dark_green(self) -> Self::Styled
fn dark_green(self) -> Self::Styled
Sets the foreground color to
DarkGreen
.sourcefn on_dark_green(self) -> Self::Styled
fn on_dark_green(self) -> Self::Styled
Sets the background color to
DarkGreen
.sourcefn underline_dark_green(self) -> Self::Styled
fn underline_dark_green(self) -> Self::Styled
Sets the underline color to
DarkGreen
.sourcefn underline_yellow(self) -> Self::Styled
fn underline_yellow(self) -> Self::Styled
Sets the underline color to
Yellow
.sourcefn dark_yellow(self) -> Self::Styled
fn dark_yellow(self) -> Self::Styled
Sets the foreground color to
DarkYellow
.sourcefn on_dark_yellow(self) -> Self::Styled
fn on_dark_yellow(self) -> Self::Styled
Sets the background color to
DarkYellow
.sourcefn underline_dark_yellow(self) -> Self::Styled
fn underline_dark_yellow(self) -> Self::Styled
Sets the underline color to
DarkYellow
.sourcefn underline_blue(self) -> Self::Styled
fn underline_blue(self) -> Self::Styled
Sets the underline color to
Blue
.sourcefn on_dark_blue(self) -> Self::Styled
fn on_dark_blue(self) -> Self::Styled
Sets the background color to
DarkBlue
.sourcefn underline_dark_blue(self) -> Self::Styled
fn underline_dark_blue(self) -> Self::Styled
Sets the underline color to
DarkBlue
.sourcefn on_magenta(self) -> Self::Styled
fn on_magenta(self) -> Self::Styled
Sets the background color to
Magenta
.sourcefn underline_magenta(self) -> Self::Styled
fn underline_magenta(self) -> Self::Styled
Sets the underline color to
Magenta
.sourcefn dark_magenta(self) -> Self::Styled
fn dark_magenta(self) -> Self::Styled
Sets the foreground color to
DarkMagenta
.sourcefn on_dark_magenta(self) -> Self::Styled
fn on_dark_magenta(self) -> Self::Styled
Sets the background color to
DarkMagenta
.sourcefn underline_dark_magenta(self) -> Self::Styled
fn underline_dark_magenta(self) -> Self::Styled
Sets the underline color to
DarkMagenta
.sourcefn underline_cyan(self) -> Self::Styled
fn underline_cyan(self) -> Self::Styled
Sets the underline color to
Cyan
.sourcefn on_dark_cyan(self) -> Self::Styled
fn on_dark_cyan(self) -> Self::Styled
Sets the background color to
DarkCyan
.sourcefn underline_dark_cyan(self) -> Self::Styled
fn underline_dark_cyan(self) -> Self::Styled
Sets the underline color to
DarkCyan
.sourcefn underline_white(self) -> Self::Styled
fn underline_white(self) -> Self::Styled
Sets the underline color to
White
.sourcefn 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 StructuralEq for ContentStyle
impl StructuralPartialEq for ContentStyle
Auto Trait Implementations
impl RefUnwindSafe for ContentStyle
impl Send for ContentStyle
impl Sync for ContentStyle
impl Unpin for ContentStyle
impl UnwindSafe for ContentStyle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more