Enum tinybit::Colored [−][src]
Represents a foreground or background color.
This can be converted to a Colors by calling into() and applied
using the SetColors command.
Variants
ForegroundColor(Color)A foreground color.
BackgroundColor(Color)A background color.
Implementations
impl Colored[src]
pub fn parse_ansi(ansi: &str) -> Option<Colored>[src]
Parse an ANSI foreground or background color.
This is the string that would appear within an ESC [ <str> m escape sequence, as found in
various configuration files.
For example:
38;5;0 -> ForegroundColor(Black),38;5;26 -> ForegroundColor(AnsiValue(26))48;2;50;60;70 -> BackgroundColor(Rgb(50, 60, 70))49 -> BackgroundColor(Reset)Invalid sequences map toNone.
Currently, 3/4 bit color values aren’t supported so return None.
See also: Color::parse_ansi
Trait Implementations
impl Clone for Colored[src]
impl Copy for Colored[src]
impl Debug for Colored[src]
impl<'de> Deserialize<'de> for Colored[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Colored, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>, [src]
__deserializer: __D
) -> Result<Colored, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Display for Colored[src]
impl Eq for Colored[src]
impl Hash for Colored[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for Colored[src]
pub fn cmp(&self, other: &Colored) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl PartialEq<Colored> for Colored[src]
impl PartialOrd<Colored> for Colored[src]
pub fn partial_cmp(&self, other: &Colored) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl Serialize for Colored[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer, [src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for Colored[src]
impl StructuralPartialEq for Colored[src]
Auto Trait Implementations
impl RefUnwindSafe for Colored
impl Send for Colored
impl Sync for Colored
impl Unpin for Colored
impl UnwindSafe for Colored
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,