pub struct RidiculousStringMap<V> { /* private fields */ }Expand description
A map with string keys that sorts strings according to object entry order, using insertion order for non-int keys.
Implementations§
Source§impl<V> RidiculousStringMap<V>
impl<V> RidiculousStringMap<V>
Sourcepub fn with_capacity(capacity: usize) -> RidiculousStringMap<V>
pub fn with_capacity(capacity: usize) -> RidiculousStringMap<V>
Create a new map with capacity for n key-value pairs. (Does not
allocate if n is zero.)
This only preallocates capacity for non-numeric strings.
Sourcepub fn insert(&mut self, key: String, val: V) -> Option<V>
pub fn insert(&mut self, key: String, val: V) -> Option<V>
Inserts a key-value pair into the map.
If the map did not have this key present, None is returned.
If the map did have this key present, the value is updated, and the old
value is returned. The key is not updated, though; this matters for
types that can be == without being identical.
Sourcepub fn iter(&self) -> Iter<'_, V> ⓘ
pub fn iter(&self) -> Iter<'_, V> ⓘ
Gets an iterator over the entries of the map. It first yields all entries with numeric keys in ascending order, and then the remaining entries in the same order in which they were inserted.
Trait Implementations§
Source§impl<V: Clone> Clone for RidiculousStringMap<V>
impl<V: Clone> Clone for RidiculousStringMap<V>
Source§fn clone(&self) -> RidiculousStringMap<V>
fn clone(&self) -> RidiculousStringMap<V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug> Debug for RidiculousStringMap<V>
impl<V: Debug> Debug for RidiculousStringMap<V>
Source§impl<V: Default> Default for RidiculousStringMap<V>
impl<V: Default> Default for RidiculousStringMap<V>
Source§fn default() -> RidiculousStringMap<V>
fn default() -> RidiculousStringMap<V>
Returns the “default value” for a type. Read more
Source§impl<'a, V> IntoIterator for &'a RidiculousStringMap<V>
impl<'a, V> IntoIterator for &'a RidiculousStringMap<V>
Source§impl<V: PartialEq> PartialEq for RidiculousStringMap<V>
impl<V: PartialEq> PartialEq for RidiculousStringMap<V>
impl<V: Eq> Eq for RidiculousStringMap<V>
impl<V> StructuralPartialEq for RidiculousStringMap<V>
Auto Trait Implementations§
impl<V> Freeze for RidiculousStringMap<V>
impl<V> RefUnwindSafe for RidiculousStringMap<V>where
V: RefUnwindSafe,
impl<V> Send for RidiculousStringMap<V>where
V: Send,
impl<V> Sync for RidiculousStringMap<V>where
V: Sync,
impl<V> Unpin for RidiculousStringMap<V>where
V: Unpin,
impl<V> UnwindSafe for RidiculousStringMap<V>where
V: RefUnwindSafe + 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<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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.