Struct Ansi256Color
#[repr(transparent)]
pub struct Ansi256Color(pub u8);
256 (8-bit) color support
Fields
0: u8
Implementations
impl Ansi256Color
fn on(self, background: impl Into<Color>) -> StyleCreate a [
Style][crate::Style] with this as the foregroundconst fn on_default(self) -> StyleCreate a [
Style][crate::Style] with this as the foregroundconst fn index(self) -> u8Get the raw value
const fn into_ansi(self) -> Option<AnsiColor>Convert to
AnsiColorwhen there is a 1:1 mappingconst fn from_ansi(color: AnsiColor) -> SelfLosslessly convert from
AnsiColorfn render_fg(self) -> impl Display + CopyRender the ANSI code for a foreground color
fn render_bg(self) -> impl Display + CopyRender the ANSI code for a background color
Trait Implementations
impl Clone for Ansi256Color
fn clone(&self) -> Ansi256Color
impl Copy for Ansi256Color
impl Debug for Ansi256Color
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Ansi256Color
impl From<AnsiColor> for Ansi256Color
fn from(inner: AnsiColor) -> Self
impl From<u8> for Ansi256Color
fn from(inner: u8) -> Self
impl Hash for Ansi256Color
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Ansi256Color
fn cmp(&self, other: &Ansi256Color) -> Ordering
impl PartialEq for Ansi256Color
fn eq(&self, other: &Ansi256Color) -> bool
impl PartialOrd for Ansi256Color
fn partial_cmp(&self, other: &Ansi256Color) -> Option<Ordering>
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 UnsafeUnpin for Ansi256Color
impl UnwindSafe for Ansi256Color
Blanket Implementations
impl<T> Any for Ansi256Color
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Ansi256Color
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Ansi256Color
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Ansi256Color
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Ansi256Color
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Ansi256Color
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Ansi256Color
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Ansi256Color
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Ansi256Color
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>