[−][src]Struct json_spanned_value::Map
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]
Q: Eq + Ord + Hash,
K: Borrow<Q>,
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]
Q: Eq + Ord + Hash,
K: Borrow<Q>,
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]
Q: Eq + Ord + Hash,
K: Borrow<Q>,
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]
Q: Eq + Ord + Hash,
K: Borrow<Q>,
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]
Q: Eq + Ord + Hash,
K: Borrow<Q>,
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]
Q: Eq + Ord + Hash,
K: Borrow<Q>,
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]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
impl<K: Hash + Ord, V> IntoIterator for Map<K, V>
[src]
Auto Trait Implementations
impl<K, V> RefUnwindSafe for Map<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Map<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for Map<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for Map<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for Map<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,