Struct flat_map::flat_map::FlatMap
[−]
[src]
pub struct FlatMap<K, V> { /* fields omitted */ }
Methods
impl<K, V> FlatMap<K, V>
[src]
fn new() -> FlatMap<K, V>
fn with_capacity(capacity: usize) -> FlatMap<K, V>
fn capacity(&self) -> usize
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);
fn reserve(&mut self, additional: usize)
fn reserve_exact(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn len(&self) -> usize
fn is_empty(&self) -> bool
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());
fn iter<'r>(&'r self) -> Iter<'r, K, V>
fn iter_mut(&mut self) -> IterMut<K, V>
fn values_mut(&mut self) -> ValuesMut<K, V>
fn keys<'a>(&'a self) -> Keys<'a, K, V>
fn values<'a>(&'a self) -> Values<'a, K, V>
fn clear(&mut self)
impl<K: Ord, V> FlatMap<K, V>
[src]
fn insert(&mut self, key: K, v: V) -> Option<V>
fn append(&mut self, other: &mut Self)
fn split_off(&mut self, key: &K) -> Self
fn get<Q: ?Sized>(&self, q: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Ord,
K: Borrow<Q>,
Q: Ord,
fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool where
K: Borrow<Q>,
Q: Ord,
K: Borrow<Q>,
Q: Ord,
fn get_mut<Q: ?Sized>(&mut self, q: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Ord,
K: Borrow<Q>,
Q: Ord,
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());
fn entry(&mut self, key: K) -> Entry<K, V>
fn remove<Q: ?Sized>(&mut self, q: &Q) -> Option<V> where
K: Borrow<Q>,
Q: Ord,
K: Borrow<Q>,
Q: Ord,
Trait Implementations
impl<K: Clone, V: Clone> Clone for FlatMap<K, V>
[src]
fn clone(&self) -> FlatMap<K, V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
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?
fn into_iter(self) -> IntoIter<K, V>
Creates an iterator from a value. Read more
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?
fn into_iter(self) -> Iter<'a, K, V>
Creates an iterator from a value. Read more
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?
fn into_iter(self) -> IterMut<'a, K, V>
Creates an iterator from a value. Read more
impl<K: Ord, V> FromIterator<(K, V)> for FlatMap<K, V>
[src]
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> FlatMap<K, V>
Creates a value from an iterator. Read more
impl<K: Ord, V> Extend<(K, V)> for FlatMap<K, V>
[src]
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for FlatMap<K, V>
[src]
fn extend<I: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<K: Hash, V: Hash> Hash for FlatMap<K, V>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<K: Ord, V> Default for FlatMap<K, V>
[src]
impl<K: Ord, V: Ord> Ord for FlatMap<K, V>
[src]
fn cmp(&self, other: &FlatMap<K, V>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<K: PartialEq, V: PartialEq> PartialEq for FlatMap<K, V>
[src]
fn eq(&self, other: &FlatMap<K, V>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<K: Eq, V: Eq> Eq for FlatMap<K, V>
[src]
impl<K: PartialOrd, V: PartialOrd> PartialOrd for FlatMap<K, V>
[src]
fn partial_cmp(&self, other: &FlatMap<K, V>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<K: Debug, V: Debug> Debug 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]
K: Borrow<Q>,
Q: Ord,