#[repr(u16)]pub enum Attribute {
Show 13 variants
Bold = 1,
Dim = 2,
Italic = 4,
Underline = 8,
Blink = 16,
Blink2 = 32,
Reverse = 64,
Conceal = 128,
Strike = 256,
Underline2 = 512,
Frame = 1_024,
Encircle = 2_048,
Overline = 4_096,
}
Expand description
Individual effects that can be applied to text in a terminal.
Attribute
values can be combined with bitwise operators to produce
AttributeSet
s.
Attribute
values can be parsed from the
following case-insensitive strings:
"bold"
or"b"
—Bold
"dim"
or"d"
—Dim
"italic"
or"i"
—Italic
"underline"
or"u"
—Underline
"blink"
—Blink
"blink2"
—Blink2
"reverse"
or"r"
—Reverse
"conceal"
or"c"
—Conceal
"strike"
or"s"
—Strike
"underline2"
or"uu"
—Underline2
"frame"
—Frame
"encircle"
—Encircle
"overline"
—Overline
Attribute
values are displayed as lowercase
strings from the above list; for values with two strings, the longer
one is used.
Variants§
Bold = 1
Dim = 2
Italic = 4
Underline = 8
Blink = 16
Blink2 = 32
Fast blinking
Reverse = 64
Reverse video
Conceal = 128
Concealed/hidden
Strike = 256
Strikethrough
Underline2 = 512
Double-underline
Frame = 1_024
Encircle = 2_048
Overline = 4_096
Implementations§
Trait Implementations§
Source§impl<A: Into<AttributeSet>> BitAnd<A> for Attribute
impl<A: Into<AttributeSet>> BitAnd<A> for Attribute
Source§type Output = AttributeSet
type Output = AttributeSet
The resulting type after applying the
&
operator.Source§fn bitand(self, rhs: A) -> AttributeSet
fn bitand(self, rhs: A) -> AttributeSet
Performs the
&
operation. Read moreSource§impl<A: Into<AttributeSet>> BitOr<A> for Attribute
impl<A: Into<AttributeSet>> BitOr<A> for Attribute
Source§type Output = AttributeSet
type Output = AttributeSet
The resulting type after applying the
|
operator.Source§fn bitor(self, rhs: A) -> AttributeSet
fn bitor(self, rhs: A) -> AttributeSet
Performs the
|
operation. Read moreSource§impl<A: Into<AttributeSet>> BitXor<A> for Attribute
impl<A: Into<AttributeSet>> BitXor<A> for Attribute
Source§type Output = AttributeSet
type Output = AttributeSet
The resulting type after applying the
^
operator.Source§fn bitxor(self, rhs: A) -> AttributeSet
fn bitxor(self, rhs: A) -> AttributeSet
Performs the
^
operation. Read moreSource§impl Extend<Attribute> for AttributeSet
impl Extend<Attribute> for AttributeSet
Source§fn extend<I: IntoIterator<Item = Attribute>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Attribute>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<Attribute> for AttributeSet
impl From<Attribute> for AttributeSet
Source§fn from(value: Attribute) -> AttributeSet
fn from(value: Attribute) -> AttributeSet
Converts to this type from the input type.
Source§impl FromIterator<Attribute> for AttributeSet
impl FromIterator<Attribute> for AttributeSet
Source§impl IntoEnumIterator for Attribute
impl IntoEnumIterator for Attribute
type Iterator = AttributeIter
fn iter() -> AttributeIter ⓘ
Source§impl Not for Attribute
impl Not for Attribute
Source§type Output = AttributeSet
type Output = AttributeSet
The resulting type after applying the
!
operator.Source§fn not(self) -> AttributeSet
fn not(self) -> AttributeSet
Performs the unary
!
operation. Read moreSource§impl Ord for Attribute
impl Ord for Attribute
Source§impl PartialOrd for Attribute
impl PartialOrd for Attribute
Source§impl<A: Into<AttributeSet>> Sub<A> for Attribute
impl<A: Into<AttributeSet>> Sub<A> for Attribute
Source§type Output = AttributeSet
type Output = AttributeSet
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: A) -> AttributeSet
fn sub(self, rhs: A) -> AttributeSet
Performs the
-
operation. Read moreimpl Copy for Attribute
impl Eq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more