Struct anstyle::Ansi256Color
source · #[repr(transparent)]pub struct Ansi256Color(pub u8);
Expand description
Tuple Fields§
§0: u8
Implementations§
source§impl Ansi256Color
impl Ansi256Color
sourcepub fn on(self, background: impl Into<Color>) -> Style
pub fn on(self, background: impl Into<Color>) -> Style
Create a Style
with this as the foreground
sourcepub fn on_default(self) -> Style
pub fn on_default(self) -> Style
Create a Style
with this as the foreground
pub const fn index(self) -> u8
pub const fn into_ansi(self) -> Option<AnsiColor>
pub const fn from_ansi(color: AnsiColor) -> Self
Trait Implementations§
source§impl Clone for Ansi256Color
impl Clone for Ansi256Color
source§fn clone(&self) -> Ansi256Color
fn clone(&self) -> Ansi256Color
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Ansi256Color
impl Debug for Ansi256Color
source§impl From<Ansi256Color> for Color
impl From<Ansi256Color> for Color
source§fn from(inner: Ansi256Color) -> Self
fn from(inner: Ansi256Color) -> Self
Converts to this type from the input type.
source§impl From<AnsiColor> for Ansi256Color
impl From<AnsiColor> for Ansi256Color
source§impl From<u8> for Ansi256Color
impl From<u8> for Ansi256Color
source§impl Hash for Ansi256Color
impl Hash for Ansi256Color
source§impl Ord for Ansi256Color
impl Ord for Ansi256Color
source§fn cmp(&self, other: &Ansi256Color) -> Ordering
fn cmp(&self, other: &Ansi256Color) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Ansi256Color
impl PartialEq for Ansi256Color
source§fn eq(&self, other: &Ansi256Color) -> bool
fn eq(&self, other: &Ansi256Color) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Ansi256Color
impl PartialOrd for Ansi256Color
source§fn partial_cmp(&self, other: &Ansi256Color) -> Option<Ordering>
fn partial_cmp(&self, other: &Ansi256Color) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl Copy for Ansi256Color
impl Eq for Ansi256Color
impl StructuralPartialEq for Ansi256Color
Auto Trait Implementations§
impl Freeze for Ansi256Color
impl RefUnwindSafe for Ansi256Color
impl Send for Ansi256Color
impl Sync for Ansi256Color
impl Unpin for Ansi256Color
impl UnwindSafe for Ansi256Color
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