[][src]Struct json_spanned_value::Map

pub struct Map<K: Hash + Ord, V> { /* fields omitted */ }

A basic un-Spanned object/map, with Spanned children.

Implementations

impl<K: Hash + Ord, V> Map<K, V>[src]

pub fn new() -> Self[src]

Makes a new empty Map.

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

Returns the number of elements in the map.

pub fn is_empty(&self) -> bool[src]

true if the map contains no elements.

pub fn clear(&mut self)[src]

Clears the map, removing all elements.

pub fn insert(&mut self, k: K, v: V) -> Option<V>[src]

Inserts a key-value pair into the map, returning the replaced value, if any.

pub fn entry(&mut self, key: K) -> Entry<'_, K, V>[src]

Gets the given key's corresponding entry in the map for in-place manipulation.

pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
    Q: Eq + Ord + Hash,
    K: Borrow<Q>, 
[src]

true if the map contains the given key.

pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
    Q: Eq + Ord + Hash,
    K: Borrow<Q>, 
[src]

Return a reference to the value stored for key, if any.

pub fn get_key_value<Q: ?Sized>(&self, key: &Q) -> Option<(&K, &V)> where
    Q: Eq + Ord + Hash,
    K: Borrow<Q>, 
[src]

Returns the key-value pair corresponding to the supplied key, if any.

pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
    Q: Eq + Ord + Hash,
    K: Borrow<Q>, 
[src]

Returns a mutable reference to the value stored for key, if any.

pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V> where
    Q: Eq + Ord + Hash,
    K: Borrow<Q>, 
[src]

Removes a key from the map, returning the previous value, if any.

pub fn remove_entry<Q: ?Sized>(&mut self, key: &Q) -> Option<(K, V)> where
    Q: Eq + Ord + Hash,
    K: Borrow<Q>, 
[src]

Removes a key from the map, returning the previous key/value pair, if any.

pub fn keys(&self) -> impl Iterator<Item = &K>[src]

Gets an iterator over the keys of the map.

pub fn values(&self) -> impl Iterator<Item = &V>[src]

Gets an iterator over the values of the map.

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>[src]

Gets a mutable iterator over the values of the map.

pub fn iter(&self) -> impl Iterator<Item = (&K, &V)>[src]

Gets an iterator over the entries of the map.

pub fn iter_mut(&mut self) -> impl Iterator<Item = (&K, &mut V)>[src]

Gets a mutable iterator over the entries of the map.

Trait Implementations

impl<K: Clone + Hash + Ord, V: Clone> Clone for Map<K, V>[src]

impl<K: Debug + Hash + Ord, V: Debug> Debug for Map<K, V>[src]

impl<'de, K: Debug + Hash + Ord + Deserialize<'de>, V: Deserialize<'de>> Deserialize<'de> for Map<K, V>[src]

impl<'a, K: Hash + Ord + 'a, V: 'a> IntoIterator for &'a Map<K, V>[src]

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

The type of the elements being iterated over.

type IntoIter = <&'a IndexMap<K, V> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

impl<'a, K: Hash + Ord + 'a, V: 'a> IntoIterator for &'a mut Map<K, V>[src]

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.

type IntoIter = <&'a mut IndexMap<K, V> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

impl<K: Hash + Ord, V> IntoIterator for Map<K, V>[src]

type Item = (K, V)

The type of the elements being iterated over.

type IntoIter = <IndexMap<K, V> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<K, V> RefUnwindSafe for Map<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for Map<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Map<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for Map<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for Map<K, V> where
    K: UnwindSafe,
    V: 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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.