pub enum Styles {
Clear,
Bold,
Dimmed,
Underline,
Reversed,
Italic,
Blink,
Hidden,
Strikethrough,
}
Expand description
Enum containing all of the available style settings that can be
applied to a Styles
and by extension, a colrized type.
§Implementation of bitwise logical operators
The implementations of BitAnd
, BitOr
, BitXor
, and
Not
are really extensions of Style
’s implementations of
the same. BitOr
is great for starting chains of Styles
’s
for creating Style
’s.
let my_styles =
// BitOr<Styles> for Styles (Styles | Styles) = Style
Styles::Bold | Styles::Underline
// BitOr<Styles> for Style (Style | Styles) = Style
| Styles::Italic;
for s in [Styles::Bold, Styles::Underline, Styles::Italic] {
assert!(my_styles.contains(s));
}
Not
has far fewer use cases but can still find use in
turning a Styles
into a Style
with all styles activated
except that Styles
.
let everything_but_bold = !Styles::Bold;
assert!(everything_but_bold.contains(Styles::Underline));
assert!(everything_but_bold.contains(Styles::Strikethrough));
assert!(!everything_but_bold.contains(Styles::Bold));
Variants§
Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)