#[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 const fn on_default(self) -> Style
pub const fn on_default(self) -> Style
Create a Style
with this as the foreground
Sourcepub const fn into_ansi(self) -> Option<AnsiColor>
pub const fn into_ansi(self) -> Option<AnsiColor>
Convert to AnsiColor
when there is a 1:1 mapping
Sourcepub const fn from_ansi(color: AnsiColor) -> Ansi256Color
pub const fn from_ansi(color: AnsiColor) -> Ansi256Color
Losslessly convert from AnsiColor
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) -> Color
fn from(inner: Ansi256Color) -> Color
Converts to this type from the input type.
Source§impl From<AnsiColor> for Ansi256Color
impl From<AnsiColor> for Ansi256Color
Source§fn from(inner: AnsiColor) -> Ansi256Color
fn from(inner: AnsiColor) -> Ansi256Color
Converts to this type from the input type.
Source§impl From<u8> for Ansi256Color
impl From<u8> for Ansi256Color
Source§fn from(inner: u8) -> Ansi256Color
fn from(inner: u8) -> Ansi256Color
Converts to this type from the input type.
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§impl PartialOrd for Ansi256Color
impl PartialOrd for Ansi256Color
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte