pub struct TermStyle { /* private fields */ }term only.Expand description
๐ฎ ๐ โ A compact set of broadly supported terminal text styles.
๐ sys/os/term
๐ฆ size_of::<TermStyle>() == 1 bytes / 8 bits
Its bits occupy the low byte of TermStyleExt with the same meanings.
Implementationsยง
Sourceยงimpl TermStyle
impl TermStyle
Sourcepub const fn extended(self) -> TermStyleExt
pub const fn extended(self) -> TermStyleExt
Returns the corresponding extended style set.
Sourceยงimpl TermStyle
Convenience methods derived from each named constant.
impl TermStyle
Convenience methods derived from each named constant.
Sourcepub const fn contains_bold(self) -> bool
pub const fn contains_bold(self) -> bool
Returns true if all bits in BOLD are present.
Sourcepub const fn intersects_bold(self) -> bool
pub const fn intersects_bold(self) -> bool
Returns true if the set shares any bit with BOLD.
Sourcepub const fn with_bold_if(self, condition: bool) -> Self
pub const fn with_bold_if(self, condition: bool) -> Self
Returns self with BOLD inserted if condition is true.
Sourcepub const fn without_bold(self) -> Self
pub const fn without_bold(self) -> Self
Returns self with BOLD removed.
Sourcepub const fn set_bold_if(&mut self, condition: bool)
pub const fn set_bold_if(&mut self, condition: bool)
Sets BOLD if condition is true.
Sourcepub const fn unset_bold(&mut self)
pub const fn unset_bold(&mut self)
Unsets BOLD.
Sourcepub const fn has_italic(self) -> bool
pub const fn has_italic(self) -> bool
Returns true if ITALIC is present.
Sourcepub const fn contains_italic(self) -> bool
pub const fn contains_italic(self) -> bool
Returns true if all bits in ITALIC are present.
Sourcepub const fn intersects_italic(self) -> bool
pub const fn intersects_italic(self) -> bool
Returns true if the set shares any bit with ITALIC.
Sourcepub const fn with_italic(self) -> Self
pub const fn with_italic(self) -> Self
Returns self with ITALIC inserted.
Sourcepub const fn with_italic_if(self, condition: bool) -> Self
pub const fn with_italic_if(self, condition: bool) -> Self
Returns self with ITALIC inserted if condition is true.
Sourcepub const fn without_italic(self) -> Self
pub const fn without_italic(self) -> Self
Returns self with ITALIC removed.
Sourcepub const fn set_italic(&mut self)
pub const fn set_italic(&mut self)
Sets ITALIC.
Sourcepub const fn set_italic_if(&mut self, condition: bool)
pub const fn set_italic_if(&mut self, condition: bool)
Sets ITALIC if condition is true.
Sourcepub const fn unset_italic(&mut self)
pub const fn unset_italic(&mut self)
Unsets ITALIC.
Sourcepub const fn has_underline(self) -> bool
pub const fn has_underline(self) -> bool
Returns true if UNDERLINE is present.
Sourcepub const fn contains_underline(self) -> bool
pub const fn contains_underline(self) -> bool
Returns true if all bits in UNDERLINE are present.
Sourcepub const fn intersects_underline(self) -> bool
pub const fn intersects_underline(self) -> bool
Returns true if the set shares any bit with UNDERLINE.
Sourcepub const fn with_underline(self) -> Self
pub const fn with_underline(self) -> Self
Returns self with UNDERLINE inserted.
Sourcepub const fn with_underline_if(self, condition: bool) -> Self
pub const fn with_underline_if(self, condition: bool) -> Self
Returns self with UNDERLINE inserted if condition is true.
Sourcepub const fn without_underline(self) -> Self
pub const fn without_underline(self) -> Self
Returns self with UNDERLINE removed.
Sourcepub const fn set_underline(&mut self)
pub const fn set_underline(&mut self)
Sets UNDERLINE.
Sourcepub const fn set_underline_if(&mut self, condition: bool)
pub const fn set_underline_if(&mut self, condition: bool)
Sets UNDERLINE if condition is true.
Sourcepub const fn unset_underline(&mut self)
pub const fn unset_underline(&mut self)
Unsets UNDERLINE.
Sourcepub const fn contains_dim(self) -> bool
pub const fn contains_dim(self) -> bool
Returns true if all bits in DIM are present.
Sourcepub const fn intersects_dim(self) -> bool
pub const fn intersects_dim(self) -> bool
Returns true if the set shares any bit with DIM.
Sourcepub const fn with_dim_if(self, condition: bool) -> Self
pub const fn with_dim_if(self, condition: bool) -> Self
Returns self with DIM inserted if condition is true.
Sourcepub const fn without_dim(self) -> Self
pub const fn without_dim(self) -> Self
Returns self with DIM removed.
Sourcepub const fn set_dim_if(&mut self, condition: bool)
pub const fn set_dim_if(&mut self, condition: bool)
Sets DIM if condition is true.
Sourcepub const fn contains_blink(self) -> bool
pub const fn contains_blink(self) -> bool
Returns true if all bits in BLINK are present.
Sourcepub const fn intersects_blink(self) -> bool
pub const fn intersects_blink(self) -> bool
Returns true if the set shares any bit with BLINK.
Sourcepub const fn with_blink(self) -> Self
pub const fn with_blink(self) -> Self
Returns self with BLINK inserted.
Sourcepub const fn with_blink_if(self, condition: bool) -> Self
pub const fn with_blink_if(self, condition: bool) -> Self
Returns self with BLINK inserted if condition is true.
Sourcepub const fn without_blink(self) -> Self
pub const fn without_blink(self) -> Self
Returns self with BLINK removed.
Sourcepub const fn set_blink_if(&mut self, condition: bool)
pub const fn set_blink_if(&mut self, condition: bool)
Sets BLINK if condition is true.
Sourcepub const fn unset_blink(&mut self)
pub const fn unset_blink(&mut self)
Unsets BLINK.
Sourcepub const fn has_inverse(self) -> bool
pub const fn has_inverse(self) -> bool
Returns true if INVERSE is present.
Sourcepub const fn contains_inverse(self) -> bool
pub const fn contains_inverse(self) -> bool
Returns true if all bits in INVERSE are present.
Sourcepub const fn intersects_inverse(self) -> bool
pub const fn intersects_inverse(self) -> bool
Returns true if the set shares any bit with INVERSE.
Sourcepub const fn with_inverse(self) -> Self
pub const fn with_inverse(self) -> Self
Returns self with INVERSE inserted.
Sourcepub const fn with_inverse_if(self, condition: bool) -> Self
pub const fn with_inverse_if(self, condition: bool) -> Self
Returns self with INVERSE inserted if condition is true.
Sourcepub const fn without_inverse(self) -> Self
pub const fn without_inverse(self) -> Self
Returns self with INVERSE removed.
Sourcepub const fn set_inverse(&mut self)
pub const fn set_inverse(&mut self)
Sets INVERSE.
Sourcepub const fn set_inverse_if(&mut self, condition: bool)
pub const fn set_inverse_if(&mut self, condition: bool)
Sets INVERSE if condition is true.
Sourcepub const fn unset_inverse(&mut self)
pub const fn unset_inverse(&mut self)
Unsets INVERSE.
Returns true if HIDDEN is present.
Returns true if all bits in HIDDEN are present.
Returns true if the set shares any bit with HIDDEN.
Returns self with HIDDEN inserted.
Returns self with HIDDEN inserted if condition is true.
Returns self with HIDDEN removed.
Sets HIDDEN.
Sets HIDDEN if condition is true.
Unsets HIDDEN.
Sourcepub const fn has_crossed(self) -> bool
pub const fn has_crossed(self) -> bool
Returns true if CROSSED is present.
Sourcepub const fn contains_crossed(self) -> bool
pub const fn contains_crossed(self) -> bool
Returns true if all bits in CROSSED are present.
Sourcepub const fn intersects_crossed(self) -> bool
pub const fn intersects_crossed(self) -> bool
Returns true if the set shares any bit with CROSSED.
Sourcepub const fn with_crossed(self) -> Self
pub const fn with_crossed(self) -> Self
Returns self with CROSSED inserted.
Sourcepub const fn with_crossed_if(self, condition: bool) -> Self
pub const fn with_crossed_if(self, condition: bool) -> Self
Returns self with CROSSED inserted if condition is true.
Sourcepub const fn without_crossed(self) -> Self
pub const fn without_crossed(self) -> Self
Returns self with CROSSED removed.
Sourcepub const fn set_crossed(&mut self)
pub const fn set_crossed(&mut self)
Sets CROSSED.
Sourcepub const fn set_crossed_if(&mut self, condition: bool)
pub const fn set_crossed_if(&mut self, condition: bool)
Sets CROSSED if condition is true.
Sourcepub const fn unset_crossed(&mut self)
pub const fn unset_crossed(&mut self)
Unsets CROSSED.
Sourceยงimpl TermStyle
Common set methods
impl TermStyle
Common set methods
Sourceยงimpl TermStyle
Set operations
impl TermStyle
Set operations
Sourcepub const fn intersects(self, other: Self) -> bool
pub const fn intersects(self, other: Self) -> bool
Returns true if self and other share any bit.
Sourcepub const fn is_subset(self, other: Self) -> bool
pub const fn is_subset(self, other: Self) -> bool
Returns true if all bits in self are also set in other.
Sourcepub const fn is_superset(self, other: Self) -> bool
pub const fn is_superset(self, other: Self) -> bool
Returns true if all bits in other are also set in self.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection of self and other.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference of self and other.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference of self and other.
Trait Implementationsยง
Sourceยงimpl BitAndAssign for TermStyle
impl BitAndAssign for TermStyle
Sourceยงfn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSourceยงimpl BitOrAssign for TermStyle
impl BitOrAssign for TermStyle
Sourceยงfn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSourceยงimpl BitSized<{ $Set::_SET_BIT_SIZE }> for TermStyle
impl BitSized<{ $Set::_SET_BIT_SIZE }> for TermStyle
Sourceยงconst BIT_SIZE: usize = _
const BIT_SIZE: usize = _
Sourceยงconst MIN_BYTE_SIZE: usize = _
const MIN_BYTE_SIZE: usize = _
Sourceยงfn bit_size(&self) -> usize
fn bit_size(&self) -> usize
Sourceยงfn min_byte_size(&self) -> usize
fn min_byte_size(&self) -> usize
Sourceยงimpl BitXorAssign for TermStyle
impl BitXorAssign for TermStyle
Sourceยงfn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreimpl Copy for TermStyle
Sourceยงimpl Debug for TermStyle
Formats the set as a prefixed binary mask over its declared bit domain.
impl Debug for TermStyle
Formats the set as a prefixed binary mask over its declared bit domain.
Sourceยงimpl DebugExt for TermStyle
impl DebugExt for TermStyle
Sourceยงimpl Display for TermStyle
Formats the set as a prefixed binary mask over its declared bit domain.
impl Display for TermStyle
Formats the set as a prefixed binary mask over its declared bit domain.
impl Eq for TermStyle
Sourceยงimpl From<TermStyle> for TermStyleExt
impl From<TermStyle> for TermStyleExt
Sourceยงimpl LowerHex for TermStyle
Formats the set as a hexadecimal mask over its declared bit domain.
impl LowerHex for TermStyle
Formats the set as a hexadecimal mask over its declared bit domain.
Sourceยงimpl Ord for TermStyle
impl Ord for TermStyle
1.21.0 (const: unstable) ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงimpl PartialOrd for TermStyle
impl PartialOrd for TermStyle
Auto Trait Implementationsยง
impl Freeze for TermStyle
impl RefUnwindSafe for TermStyle
impl Send for TermStyle
impl Sync for TermStyle
impl Unpin for TermStyle
impl UnsafeUnpin for TermStyle
impl UnwindSafe for TermStyle
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.