Struct anstyle::XTermColor
source · [−]#[repr(transparent)]pub struct XTermColor(pub u8);Expand description
Index into the 8-bit ANSI color palette
Tuple Fields
0: u8Implementations
Trait Implementations
sourceimpl<C: Into<Color>> BitOr<C> for XTermColor
impl<C: Into<Color>> BitOr<C> for XTermColor
Define style with specified foreground and background colors
Examples
let black = anstyle::XTermColor(16);
let white = anstyle::XTermColor(231);
let style = black | white;sourceimpl BitOr<Effects> for XTermColor
impl BitOr<Effects> for XTermColor
Define style with specified foreground color and effects
Examples
let color = anstyle::XTermColor(0);
let style = color | anstyle::Effects::BOLD | anstyle::Effects::UNDERLINE;sourceimpl Clone for XTermColor
impl Clone for XTermColor
sourcefn clone(&self) -> XTermColor
fn clone(&self) -> XTermColor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for XTermColor
impl Debug for XTermColor
sourceimpl From<XTermColor> for Color
impl From<XTermColor> for Color
sourcefn from(inner: XTermColor) -> Self
fn from(inner: XTermColor) -> Self
Converts to this type from the input type.
sourceimpl From<XTermColor> for Style
impl From<XTermColor> for Style
Define style with specified foreground color
Examples
let style: anstyle::Style = anstyle::XTermColor(0).into();sourcefn from(color: XTermColor) -> Self
fn from(color: XTermColor) -> Self
Converts to this type from the input type.
sourceimpl From<u8> for XTermColor
impl From<u8> for XTermColor
sourceimpl Hash for XTermColor
impl Hash for XTermColor
sourceimpl Ord for XTermColor
impl Ord for XTermColor
sourcefn cmp(&self, other: &XTermColor) -> Ordering
fn cmp(&self, other: &XTermColor) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<XTermColor> for XTermColor
impl PartialEq<XTermColor> for XTermColor
sourcefn eq(&self, other: &XTermColor) -> bool
fn eq(&self, other: &XTermColor) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &XTermColor) -> bool
fn ne(&self, other: &XTermColor) -> bool
This method tests for !=.
sourceimpl PartialOrd<XTermColor> for XTermColor
impl PartialOrd<XTermColor> for XTermColor
sourcefn partial_cmp(&self, other: &XTermColor) -> Option<Ordering>
fn partial_cmp(&self, other: &XTermColor) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for XTermColor
impl Eq for XTermColor
impl StructuralEq for XTermColor
impl StructuralPartialEq for XTermColor
Auto Trait Implementations
impl RefUnwindSafe for XTermColor
impl Send for XTermColor
impl Sync for XTermColor
impl Unpin for XTermColor
impl UnwindSafe for XTermColor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more