[][src]Struct flat_map::flat_map::FlatMap

pub struct FlatMap<K, V> { /* fields omitted */ }

Methods

impl<K, V> FlatMap<K, V>[src]

pub fn new() -> FlatMap<K, V>[src]

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

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

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

Examples

use flat_map::FlatMap;
let map: FlatMap<String, String> = FlatMap::with_capacity(10);
assert!(map.capacity() >= 10);

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

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

pub fn shrink_to_fit(&mut self)[src]

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

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

Return true if the map contains no elements.

Examples

use flat_map::FlatMap;

let mut a = FlatMap::new();
assert!(a.is_empty());
a.insert("1", "a");
assert!(!a.is_empty());

pub fn iter<'r>(&'r self) -> Iter<'r, K, V>[src]

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

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

pub fn keys<'a>(&'a self) -> Keys<'a, K, V>[src]

pub fn values<'a>(&'a self) -> Values<'a, K, V>[src]

pub fn clear(&mut self)[src]

pub fn into_inner(self) -> Vec<(K, V)>[src]

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

impl<K: Ord, V> FlatMap<K, V>[src]

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

pub fn append(&mut self, other: &mut Self)[src]

pub fn split_off(&mut self, key: &K) -> Self[src]

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

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

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

Return Option<&mut V>.

Example

use flat_map::FlatMap;

let mut m = FlatMap::new();
m.insert(1, "foo".to_string());
m.get_mut(&1).unwrap().push_str("bar");
assert_eq!("foobar", m.get_mut(&1).unwrap());

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

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

Trait Implementations

impl<K: Clone, V: Clone> Clone for FlatMap<K, V>[src]

impl<K: Debug, V: Debug> Debug for FlatMap<K, V>[src]

impl<K: Default, V: Default> Default for FlatMap<K, V>[src]

impl<K: Eq, V: Eq> Eq for FlatMap<K, V>[src]

impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for FlatMap<K, V>[src]

impl<K: Ord, V> Extend<(K, V)> for FlatMap<K, V>[src]

impl<K: Ord, V> FromIterator<(K, V)> for FlatMap<K, V>[src]

impl<K: Hash, V: Hash> Hash for FlatMap<K, V>[src]

impl<'a, K: Ord, Q: ?Sized, V> Index<&'a Q> for FlatMap<K, V> where
    K: Borrow<Q>,
    Q: Ord
[src]

type Output = V

The returned type after indexing.

impl<'a, K: Ord, Q: ?Sized, V> IndexMut<&'a Q> for FlatMap<K, V> where
    K: BorrowMut<Q>,
    Q: Ord
[src]

impl<K, V> IntoIterator for FlatMap<K, V>[src]

type Item = (K, V)

The type of the elements being iterated over.

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?

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

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

The type of the elements being iterated over.

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?

impl<'a, K, V> IntoIterator for &'a mut FlatMap<K, V>[src]

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

The type of the elements being iterated over.

type IntoIter = IterMut<'a, K, V>

Which kind of iterator are we turning this into?

impl<K: Ord, V: Ord> Ord for FlatMap<K, V>[src]

impl<K: PartialEq, V: PartialEq> PartialEq<FlatMap<K, V>> for FlatMap<K, V>[src]

impl<K: PartialOrd, V: PartialOrd> PartialOrd<FlatMap<K, V>> for FlatMap<K, V>[src]

Auto Trait Implementations

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

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

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

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

impl<K, V> UnwindSafe for FlatMap<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> 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.