Struct style::custom_properties::OrderedMap
[−]
[src]
pub struct OrderedMap<K, V> where
K: PrecomputedHash + Hash + Eq + Clone, { /* fields omitted */ }
A map that preserves order for the keys, and that is easily indexable.
Methods
impl<K, V> OrderedMap<K, V> where
K: Eq + PrecomputedHash + Hash + Clone,
[src]
K: Eq + PrecomputedHash + Hash + Clone,
pub fn new() -> Self
[src]
Creates a new ordered map.
pub fn insert(&mut self, key: K, value: V)
[src]
Insert a new key-value pair.
pub fn get(&self, key: &K) -> Option<&V>
[src]
Get a value given its key.
pub fn contains_key(&self, key: &K) -> bool
[src]
Get whether there's a value on the map for key
.
pub fn get_key_at(&self, index: u32) -> Option<&K>
[src]
Get the key located at the given index.
ⓘImportant traits for OrderedMapIterator<'a, K, V>pub fn iter<'a>(&'a self) -> OrderedMapIterator<'a, K, V>
[src]
ⓘImportant traits for OrderedMapIterator<'a, K, V>
Get an ordered map iterator.
pub fn len(&self) -> usize
[src]
Get the count of items in the map.
pub fn is_empty(&self) -> bool
[src]
Returns whether this map is empty.
Trait Implementations
impl<K: Clone, V: Clone> Clone for OrderedMap<K, V> where
K: PrecomputedHash + Hash + Eq + Clone,
[src]
K: PrecomputedHash + Hash + Eq + Clone,
fn clone(&self) -> OrderedMap<K, V>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<K: Debug, V: Debug> Debug for OrderedMap<K, V> where
K: PrecomputedHash + Hash + Eq + Clone,
[src]
K: PrecomputedHash + Hash + Eq + Clone,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<K: Eq, V: Eq> Eq for OrderedMap<K, V> where
K: PrecomputedHash + Hash + Eq + Clone,
[src]
K: PrecomputedHash + Hash + Eq + Clone,
impl<K: PartialEq, V: PartialEq> PartialEq for OrderedMap<K, V> where
K: PrecomputedHash + Hash + Eq + Clone,
[src]
K: PrecomputedHash + Hash + Eq + Clone,
fn eq(&self, __arg_0: &OrderedMap<K, V>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &OrderedMap<K, V>) -> bool
[src]
This method tests for !=
.