Struct starlark_map::sorted_map::SortedMap
source · pub struct SortedMap<K, V> { /* private fields */ }
Expand description
IndexMap
but with keys sorted.
Implementations§
source§impl<K, V> SortedMap<K, V>
impl<K, V> SortedMap<K, V>
sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = (&K, &V)>
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&K, &V)>
Iterate over the entries.
sourcepub fn iter_mut(&mut self) -> impl ExactSizeIterator<Item = (&K, &mut V)>
pub fn iter_mut(&mut self) -> impl ExactSizeIterator<Item = (&K, &mut V)>
Iterate over the entries, with mutable values.
sourcepub fn keys(&self) -> impl ExactSizeIterator<Item = &K>
pub fn keys(&self) -> impl ExactSizeIterator<Item = &K>
Iterate over the keys.
sourcepub fn values(&self) -> impl ExactSizeIterator<Item = &V>
pub fn values(&self) -> impl ExactSizeIterator<Item = &V>
Iterate over the values.
sourcepub fn values_mut(&mut self) -> impl ExactSizeIterator<Item = &mut V>
pub fn values_mut(&mut self) -> impl ExactSizeIterator<Item = &mut V>
Iterate over the values mutably.
sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Get a reference to the value associated with the given key.
sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Get a mutable reference to the value associated with the given key.
sourcepub fn contains_key<Q>(&self, k: &Q) -> bool
pub fn contains_key<Q>(&self, k: &Q) -> bool
Check if the map contains the given key.
sourcepub fn iter_hashed(&self) -> IterHashed<'_, K, V> ⓘ
pub fn iter_hashed(&self) -> IterHashed<'_, K, V> ⓘ
Iterate over the map with hashes.
Trait Implementations§
source§impl<K: Allocative, V: Allocative> Allocative for SortedMap<K, V>
impl<K: Allocative, V: Allocative> Allocative for SortedMap<K, V>
source§impl<'de, K, V> Deserialize<'de> for SortedMap<K, V>
impl<'de, K, V> Deserialize<'de> for SortedMap<K, V>
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<K: Ord + Hash, V> From<OrderedMap<K, V>> for SortedMap<K, V>
impl<K: Ord + Hash, V> From<OrderedMap<K, V>> for SortedMap<K, V>
source§fn from(map: OrderedMap<K, V>) -> SortedMap<K, V>
fn from(map: OrderedMap<K, V>) -> SortedMap<K, V>
Converts to this type from the input type.
source§impl<K: Ord, V: Ord> Ord for SortedMap<K, V>
impl<K: Ord, V: Ord> Ord for SortedMap<K, V>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<K: PartialEq, V: PartialEq> PartialEq for SortedMap<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq for SortedMap<K, V>
source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for SortedMap<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for SortedMap<K, V>
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 moreimpl<K: Eq, V: Eq> Eq for SortedMap<K, V>
impl<K, V> StructuralPartialEq for SortedMap<K, V>
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for SortedMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for SortedMap<K, V>
impl<K, V> Sync for SortedMap<K, V>
impl<K, V> Unpin for SortedMap<K, V>
impl<K, V> UnwindSafe for SortedMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.