Struct base16_color_scheme::scheme::BaseIndex
source · pub struct BaseIndex(pub u8);
Expand description
type representing a base16 colorscheme key
BaseIndex
has a custom Serialize
/Deserialze
to
turn base07
to BaseIndex(0x07)
and back.
Examples
use base16_color_scheme::scheme::{BaseIndex, RgbColor};
use std::collections::BTreeMap;
let map: BTreeMap<BaseIndex, RgbColor> = serde_yaml::from_str("base07: 7cafc2").unwrap();
assert_eq!(
map,
BTreeMap::from([(BaseIndex(0x07), RgbColor([0x7c, 0xaf, 0xc2]))])
);
this is pretty much what happens in Scheme::colors
.
Tuple Fields§
§0: u8
Trait Implementations§
source§impl<'de> Deserialize<'de> for BaseIndex
impl<'de> Deserialize<'de> for BaseIndex
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for BaseIndex
impl Ord for BaseIndex
source§impl PartialEq<BaseIndex> for BaseIndex
impl PartialEq<BaseIndex> for BaseIndex
source§impl PartialOrd<BaseIndex> for BaseIndex
impl PartialOrd<BaseIndex> for BaseIndex
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 more