pub enum Styles {
Clear,
Bold,
Dimmed,
Underline,
Reversed,
Italic,
Blink,
Hidden,
Strikethrough,
}Expand description
Individual style flags that can be applied to text.
§Bitwise Operations
- Combine styles:
Styles::Bold | Styles::Italic→ returns aStyle - Invert a style:
!Styles::Bold→ returns aStylewith all styles except Bold - Combine with existing Style:
existingStyle | Styles::Underline
§Example
use cnxt::*;
// Create a Style with multiple attributes
let style = Styles::Bold | Styles::Underline;
assert!(style.contains(Styles::Bold));
// Create a Style with everything but Bold
let not_bold = !Styles::Bold;
assert!(!not_bold.contains(Styles::Bold));
assert!(not_bold.contains(Styles::Underline));Variants§
Trait Implementations§
Source§impl BitAndAssign<&Styles> for Style
impl BitAndAssign<&Styles> for Style
Source§fn bitand_assign(&mut self, other: &Styles)
fn bitand_assign(&mut self, other: &Styles)
Performs the
&= operation. Read moreSource§impl BitAndAssign<Styles> for Style
impl BitAndAssign<Styles> for Style
Source§fn bitand_assign(&mut self, other: Styles)
fn bitand_assign(&mut self, other: Styles)
Performs the
&= operation. Read moreSource§impl BitOrAssign<&Styles> for Style
impl BitOrAssign<&Styles> for Style
Source§fn bitor_assign(&mut self, other: &Styles)
fn bitor_assign(&mut self, other: &Styles)
Performs the
|= operation. Read moreSource§impl BitOrAssign<Styles> for Style
impl BitOrAssign<Styles> for Style
Source§fn bitor_assign(&mut self, other: Styles)
fn bitor_assign(&mut self, other: Styles)
Performs the
|= operation. Read moreSource§impl BitXorAssign<&Styles> for Style
impl BitXorAssign<&Styles> for Style
Source§fn bitxor_assign(&mut self, other: &Styles)
fn bitxor_assign(&mut self, other: &Styles)
Performs the
^= operation. Read moreSource§impl BitXorAssign<Styles> for Style
impl BitXorAssign<Styles> for Style
Source§fn bitxor_assign(&mut self, other: Styles)
fn bitxor_assign(&mut self, other: Styles)
Performs the
^= operation. Read moreSource§impl FromIterator<Styles> for Style
impl FromIterator<Styles> for Style
impl Copy for Styles
impl Eq for Styles
impl StructuralPartialEq for Styles
Auto Trait Implementations§
impl Freeze for Styles
impl RefUnwindSafe for Styles
impl Send for Styles
impl Sync for Styles
impl Unpin for Styles
impl UnwindSafe for Styles
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