pub struct CategoricalColorMap { /* private fields */ }Expand description
Exact caller-owned colors for categorical plot levels.
Implementations§
Source§impl CategoricalColorMap
impl CategoricalColorMap
Sourcepub fn new(
input: impl IntoIterator<Item = (String, OpaqueColor)>,
) -> Result<Self, Error>
pub fn new( input: impl IntoIterator<Item = (String, OpaqueColor)>, ) -> Result<Self, Error>
Constructs a non-empty color map with unique, exact category labels.
§Errors
Returns an error when a label is empty, has surrounding whitespace or control characters, or appears more than once.
Sourcepub fn entries(&self) -> impl ExactSizeIterator<Item = (&str, OpaqueColor)> + '_
pub fn entries(&self) -> impl ExactSizeIterator<Item = (&str, OpaqueColor)> + '_
Inspect supplied raw keys and opaque colors in construction order.
Sourcepub fn color(&self, label: &str) -> Option<OpaqueColor>
pub fn color(&self, label: &str) -> Option<OpaqueColor>
Look up one exact raw key without trimming, display aliases or normalization.
Trait Implementations§
Source§impl Clone for CategoricalColorMap
impl Clone for CategoricalColorMap
Source§impl Debug for CategoricalColorMap
impl Debug for CategoricalColorMap
impl Eq for CategoricalColorMap
Source§impl PartialEq for CategoricalColorMap
impl PartialEq for CategoricalColorMap
impl StructuralPartialEq for CategoricalColorMap
Auto Trait Implementations§
impl Forget for CategoricalColorMap
impl Freeze for CategoricalColorMapwhere
*const ArcInner<Vec<(String, OpaqueColor)>> is !null: Freeze,
PhantomData<ArcInner<Vec<(String, OpaqueColor)>>>: Freeze,
impl Move for CategoricalColorMap
impl RefUnwindSafe for CategoricalColorMap
impl Send for CategoricalColorMap
impl Sync for CategoricalColorMap
impl Unpin for CategoricalColorMap
impl UnsafeUnpin for CategoricalColorMapwhere
*const ArcInner<Vec<(String, OpaqueColor)>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<(String, OpaqueColor)>>>: UnsafeUnpin,
impl UnwindSafe for CategoricalColorMap
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.