pub struct Style {
pub fg: Option<Color>,
pub bg: Option<Color>,
pub bold: bool,
pub dim: bool,
pub italic: bool,
pub underline: bool,
pub strike: bool,
pub reverse: bool,
}Fields§
§fg: Option<Color>§bg: Option<Color>§bold: bool§dim: bool§italic: bool§underline: bool§strike: bool§reverse: boolImplementations§
Source§impl Style
impl Style
pub const PLAIN: Style
pub const fn fg(color: Color) -> Self
pub const fn bold() -> Self
pub const fn with_bold(self) -> Self
pub const fn with_dim(self) -> Self
pub const fn with_italic(self) -> Self
pub const fn with_underline(self) -> Self
pub const fn with_strike(self) -> Self
pub const fn with_fg(self, color: Color) -> Self
Sourcepub fn over(self, other: Style) -> Style
pub fn over(self, other: Style) -> Style
Layers other on top of self: boolean attributes accumulate and other’s
colors win when it defines them. This is what makes **_bold italic_** work by
stacking styles instead of replacing them.
pub fn is_plain(&self) -> bool
Trait Implementations§
impl Copy for Style
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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