[][src]Struct case_insensitive_hashmap::CaseInsensitiveHashMap

pub struct CaseInsensitiveHashMap<V, S = RandomState> where
    S: BuildHasher
{ /* fields omitted */ }

Implementations

impl<V> CaseInsensitiveHashMap<V, RandomState>[src]

pub fn new() -> Self[src]

Creates a new CaseInsensitiveHashMap with the default hasher and capacity.

pub fn with_capacity(capacity: usize) -> CaseInsensitiveHashMap<V, RandomState>[src]

Creates a new CaseInsensitiveHashMap with the default hasher and specified capacity.

impl<V, S> CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

pub fn with_hasher(hash_builder: S) -> Self[src]

Creates a new CaseInsensitiveHashMap with the specified hasher and default capacity.

pub fn with_capacity_and_hasher(
    capacity: usize,
    hash_builder: S
) -> CaseInsensitiveHashMap<V, S>
[src]

Creates a new CaseInsensitiveHashMap with the specified capacity and hasher.

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

Returns the number of elements the map can hold without reallocating.

This number is a lower bound; the HashMap might be able to hold more, but is guaranteed to be able to hold at least this many.

pub fn clear(&mut self)[src]

Clears the map, removing all key-value pairs. Keeps the allocated memory for reuse.

pub fn contains_key<K: Into<UniCase<String>>>(&self, k: K) -> bool[src]

Returns true if the map contains a value for the specified key. The key may be a String, str or UniCase value.

pub fn drain(&mut self) -> Drain<UniCase<String>, V>[src]

Clears the map, returning all key-value pairs as an iterator. Keeps the allocated memory for reuse.

pub fn entry<K: Into<UniCase<String>>>(
    &mut self,
    k: K
) -> Entry<UniCase<String>, V>
[src]

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

pub fn get<K: Into<UniCase<String>>>(&self, k: K) -> Option<&V>[src]

Returns a reference to the value corresponding to the key. The key may be a String, str or UniCase value.

pub fn get_key_value<K: Into<UniCase<String>>>(
    &self,
    k: K
) -> Option<(&UniCase<String>, &V)>
[src]

Returns the key-value pair corresponding to the supplied key. The key may be a String, str or UniCase value.

pub fn get_mut<K: Into<UniCase<String>>>(&mut self, k: K) -> Option<&mut V>[src]

Returns a mutable reference to the value corresponding to the key. The key may be a String, str or UniCase value.

pub fn hasher(&self) -> &S[src]

Returns a reference to the map's BuildHasher.

pub fn insert<K: Into<UniCase<String>>>(&mut self, k: K, v: 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. See the module-level documentation of HashMap

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

Returns true if the map contains no elements.

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

An iterator visiting all key-value pairs in arbitrary order. The iterator element type is (&'a UniCase, &'a V).

pub fn iter_mut(&mut self) -> IterMut<UniCase<String>, V>[src]

An iterator visiting all key-value pairs in arbitrary order, with mutable references to the values. The iterator element type is (&'a UniCase, &'a mut V).

pub fn keys(&self) -> Keys<UniCase<String>, V>[src]

An iterator visiting all keys in arbitrary order. The iterator element type is &'a UniCase.

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

Returns the number of elements in the map.

pub fn remove<K: Into<UniCase<String>>>(&mut self, k: K) -> Option<V>[src]

Removes a key from the map, returning the value at the key if the key was previously in the map. The key may be a String, str or UniCase value.

pub fn remove_entry<K: Into<UniCase<String>>>(
    &mut self,
    k: K
) -> Option<(UniCase<String>, V)>
[src]

Removes a key from the map, returning the stored key and value if the key was previously in the map. The key may be a String, str or UniCase value.

pub fn reserve(&mut self, additional: usize)[src]

in the HashMap. The collection may reserve more space to avoid frequent reallocations.

Panics

Panics if the new allocation size overflows usize.

pub fn retain<F>(&mut self, f: F) where
    F: FnMut(&UniCase<String>, &mut V) -> bool
[src]

Retains only the elements specified by the predicate. In other words, remove all pairs (k, v) such that f(&k,&mut v) returns false.

pub fn shrink_to_fit(&mut self)[src]

Shrinks the capacity of the map as much as possible. It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.

pub fn values(&self) -> Values<UniCase<String>, V>[src]

An iterator visiting all values in arbitrary order. The iterator element type is &'a V.

pub fn values_mut(&mut self) -> ValuesMut<UniCase<String>, V>[src]

An iterator visiting all values mutably in arbitrary order. The iterator element type is &'a mut V.

Trait Implementations

impl<V: Clone, S: Clone> Clone for CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

impl<V: Debug, S: Debug> Debug for CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

impl<V: Default, S: Default> Default for CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

impl<V, S> Eq for CaseInsensitiveHashMap<V, S> where
    V: Eq,
    S: BuildHasher
[src]

impl<'a, K, V, S> Extend<(K, &'a V)> for CaseInsensitiveHashMap<V, S> where
    K: Into<UniCase<String>>,
    S: BuildHasher,
    V: Copy
[src]

impl<K, V, S> Extend<(K, V)> for CaseInsensitiveHashMap<V, S> where
    K: Into<UniCase<String>>,
    S: BuildHasher
[src]

impl<K, V> FromIterator<(K, V)> for CaseInsensitiveHashMap<V> where
    K: Into<UniCase<String>>, 
[src]

impl<'a, K, V, S> Index<K> for CaseInsensitiveHashMap<V, S> where
    K: Into<UniCase<String>>,
    S: BuildHasher
[src]

type Output = V

The returned type after indexing.

impl<'a, V, S> IntoIterator for &'a CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

type Item = (&'a UniCase<String>, &'a V)

The type of the elements being iterated over.

type IntoIter = Iter<'a, UniCase<String>, V>

Which kind of iterator are we turning this into?

impl<'a, V, S> IntoIterator for &'a mut CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

type Item = (&'a UniCase<String>, &'a mut V)

The type of the elements being iterated over.

type IntoIter = IterMut<'a, UniCase<String>, V>

Which kind of iterator are we turning this into?

impl<V, S> IntoIterator for CaseInsensitiveHashMap<V, S> where
    S: BuildHasher
[src]

type Item = (UniCase<String>, V)

The type of the elements being iterated over.

type IntoIter = IntoIter<UniCase<String>, V>

Which kind of iterator are we turning this into?

impl<V, S> PartialEq<CaseInsensitiveHashMap<V, S>> for CaseInsensitiveHashMap<V, S> where
    V: PartialEq,
    S: BuildHasher
[src]

Auto Trait Implementations

impl<V, S> RefUnwindSafe for CaseInsensitiveHashMap<V, S> where
    S: RefUnwindSafe,
    V: RefUnwindSafe

impl<V, S> Send for CaseInsensitiveHashMap<V, S> where
    S: Send,
    V: Send

impl<V, S> Sync for CaseInsensitiveHashMap<V, S> where
    S: Sync,
    V: Sync

impl<V, S> Unpin for CaseInsensitiveHashMap<V, S> where
    S: Unpin,
    V: Unpin

impl<V, S> UnwindSafe for CaseInsensitiveHashMap<V, S> where
    S: 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> 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.