[][src]Struct ssb_json_msg_data::value::RidiculousStringMap

pub struct RidiculousStringMap<V> { /* fields omitted */ }

A map with string keys that sorts strings according to object entry order, using insertion order for non-int keys.

Methods

impl<V> RidiculousStringMap<V>[src]

pub fn with_capacity(capacity: usize) -> RidiculousStringMap<V>[src]

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.

pub fn len(&self) -> usize[src]

Returns the number of elements in the map.

pub fn insert(&mut self, key: String, val: V) -> Option<V>[src]

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.

pub fn remove(&mut self, key: String) -> Option<V>[src]

Deletes a key-value pair from the map.

pub fn iter(&self) -> Iter<V>[src]

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.

pub fn get(&self, key: &str) -> Option<&V>[src]

Returns a reference to the value corresponding to the key.

pub fn get_mut(&mut self, key: &str) -> Option<&mut V>[src]

Returns a reference to the value corresponding to the key.

Trait Implementations

impl<V: Clone> Clone for RidiculousStringMap<V>[src]

impl<V: Debug> Debug for RidiculousStringMap<V>[src]

impl<V: Default> Default for RidiculousStringMap<V>[src]

impl<V: Eq> Eq for RidiculousStringMap<V>[src]

impl<'a, V> IntoIterator for &'a RidiculousStringMap<V>[src]

type Item = (&'a String, &'a V)

The type of the elements being iterated over.

type IntoIter = Iter<'a, V>

Which kind of iterator are we turning this into?

impl<V: PartialEq> PartialEq<RidiculousStringMap<V>> for RidiculousStringMap<V>[src]

impl<V> StructuralEq for RidiculousStringMap<V>[src]

impl<V> StructuralPartialEq for RidiculousStringMap<V>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.