pub struct Style {
pub fg: Color,
pub bg: Color,
pub bold: bool,
pub dim: bool,
pub italic: bool,
pub underline: bool,
pub reverse: bool,
pub strike: bool,
}Expand description
A complete character style: foreground, background, and attributes.
Fields§
§fg: Color§bg: Color§bold: bool§dim: bool§italic: bool§underline: bool§reverse: bool§strike: boolImplementations§
Source§impl Style
impl Style
Sourcepub fn sgr(&self) -> String
pub fn sgr(&self) -> String
The absolute SGR sequence for this style: a reset followed by every
set attribute, so it renders identically regardless of prior state.
The default style renders as ESC[0m.
Sourcepub fn transition_to(&self, to: &Style) -> String
pub fn transition_to(&self, to: &Style) -> String
The minimal SGR sequence that changes a terminal currently displaying
self to display to. Returns "" when the styles are equal. When
to only adds attributes, only the additions are emitted; when
anything must be turned off, the absolute form of to is emitted
(reset + set), which is always correct.
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