[−][src]Struct flat_map::flat_map::FlatMap
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());
ⓘImportant traits for Iter<'a, K, V>pub fn iter<'r>(&'r self) -> Iter<'r, K, V>
[src]
ⓘImportant traits for Iter<'a, K, V>
ⓘImportant traits for IterMut<'a, K, V>pub fn iter_mut(&mut self) -> IterMut<K, V>
[src]
ⓘImportant traits for IterMut<'a, K, V>
ⓘImportant traits for ValuesMut<'a, K, V>pub fn values_mut(&mut self) -> ValuesMut<K, V>
[src]
ⓘImportant traits for ValuesMut<'a, K, V>
ⓘImportant traits for Keys<'a, K, V>pub fn keys<'a>(&'a self) -> Keys<'a, K, V>
[src]
ⓘImportant traits for Keys<'a, K, V>
ⓘImportant traits for Values<'a, K, V>pub fn values<'a>(&'a self) -> Values<'a, K, V>
[src]
ⓘImportant traits for Values<'a, K, V>
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]
F: FnMut(&K, &V) -> bool,
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]
K: Borrow<Q>,
Q: Ord,
pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool where
K: Borrow<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
Q: Ord,
pub fn get_mut<Q: ?Sized>(&mut self, q: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Ord,
[src]
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());
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]
K: Borrow<Q>,
Q: Ord,
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]
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
[src]
impl<K: Ord, V> FromIterator<(K, V)> for FlatMap<K, V>
[src]
impl<K: Hash, V: Hash> Hash for FlatMap<K, V>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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,
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?
ⓘImportant traits for IntoIter<K, V>fn into_iter(self) -> IntoIter<K, V>
[src]
ⓘImportant traits for IntoIter<K, V>
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?
ⓘImportant traits for Iter<'a, K, V>fn into_iter(self) -> Iter<'a, K, V>
[src]
ⓘImportant traits for Iter<'a, K, V>
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?
ⓘImportant traits for IterMut<'a, K, V>fn into_iter(self) -> IterMut<'a, K, V>
[src]
ⓘImportant traits for IterMut<'a, K, V>
impl<K: Ord, V: Ord> Ord for FlatMap<K, V>
[src]
fn cmp(&self, other: &FlatMap<K, V>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<K: PartialEq, V: PartialEq> PartialEq<FlatMap<K, V>> for FlatMap<K, V>
[src]
fn eq(&self, other: &FlatMap<K, V>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[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,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for FlatMap<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for FlatMap<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for FlatMap<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for FlatMap<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> 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>,