pub struct SgrState {
pub(crate) fg: Option<Rgb>,
pub(crate) bg: Option<Rgb>,
}Expand description
Foreground/background overrides carried by ANSI SGR, cleared by reset.
Fields§
§fg: Option<Rgb>§bg: Option<Rgb>Implementations§
Source§impl SgrState
impl SgrState
pub const fn new() -> Self
pub fn reset(&mut self)
pub fn fg(&self) -> Option<Rgb>
pub fn bg(&self) -> Option<Rgb>
Sourcepub fn apply(&mut self, params: &[u8]) -> bool
pub fn apply(&mut self, params: &[u8]) -> bool
Apply one SGR parameter list: the bytes between ESC [ and the final
m (digits and ; only). All-or-nothing: on a malformed or unknown
sequence the state is left untouched and false is returned.
Sourcepub fn apply_params(&mut self, params: &[u16]) -> bool
pub fn apply_params(&mut self, params: &[u16]) -> bool
Same as SgrState::apply for an already-split numeric parameter list
(e.g. [1, 31]), so a caller that parses parameters itself can reuse
the semantics. An empty list is SGR 0, i.e. a full reset.
Trait Implementations§
impl Copy for SgrState
impl Eq for SgrState
impl StructuralPartialEq for SgrState
Auto Trait Implementations§
impl Forget for SgrState
impl Freeze for SgrState
impl Move for SgrState
impl RefUnwindSafe for SgrState
impl Send for SgrState
impl Sync for SgrState
impl Unpin for SgrState
impl UnsafeUnpin for SgrState
impl UnwindSafe for SgrState
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