pub struct ListMap<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> { /* private fields */ }
Expand description
A map based on an association list.
Conventionally, this refers to a linked list of key-value pairs, using a linear scan to find the value associated with a given key. This is simple, though inefficient, particularly on modern computer architectures, where traversing each link in the list is likely to cause a cache miss.
For this reason, this implementation uses arrays instead, one for the keys, one for the values. This way, unrelated values need not be fetched into the cache during the key lookup. Nonetheless, this search is O(n), i.e. it takes time linear in the number of entries, which can be problematic for large maps.
Newly inserted entries are appended to the arrays, and a removed entry is replaced by the last one in the list, meaning modifications have constant overhead after the initial lookup. This also means insertion order is not preserved.
As key search is the primary cost of these operations, care should be taken
to avoid redundant lookups. Use the Entry
API where
applicable.
It is required that the keys implement the Eq
trait, although this can
frequently be achieved using #[derive(PartialEq, Eq)]
.
It is a logic error for a key to be modified in such a way that its equality,
as determined by the Eq
trait, changes while it is in the map. This is
normally only possible through Cell
,
RefCell
, global state, I/O, or unsafe code. The
behavior resulting from such a logic error is not specified, but will not
result in undefined behavior. This could include panics, incorrect results,
aborts, memory leaks, and non-termination.
Implementations
sourceimpl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> ListMap<K, V, S, I>
impl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> ListMap<K, V, S, I>
sourcepub fn keys(&self) -> &[K]
pub fn keys(&self) -> &[K]
Returns a slice of all keys in the map in arbitrary order.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
for key in map.keys() {
println!("{}", key);
}
sourcepub fn values(&self) -> &[V]
pub fn values(&self) -> &[V]
Returns a slice of all values in the map in arbitrary order.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
for val in map.values() {
println!("{}", val);
}
sourcepub fn values_mut(&mut self) -> &mut [V]
pub fn values_mut(&mut self) -> &mut [V]
Returns a mutable slice of all values in the map in arbitrary order.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
for val in map.values_mut() {
*val = *val * 2;
}
assert_eq!(map.get("a"), Some(&2));
assert_eq!(map.get("b"), Some(&4));
assert_eq!(map.get("c"), Some(&6));
sourcepub fn iter(&self) -> Iter<'_, K, V, S, I>ⓘNotable traits for Iter<'a, K, V, S, I>impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for Iter<'a, K, V, S, I> type Item = (&'a K, &'a V);
pub fn iter(&self) -> Iter<'_, K, V, S, I>ⓘNotable traits for Iter<'a, K, V, S, I>impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for Iter<'a, K, V, S, I> type Item = (&'a K, &'a V);
An iterator visiting all key-value pairs in arbitrary order.
The iterator element type is (&'a K, &'a V)
.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
for (key, val) in map.iter() {
println!("{} -> {}", key, val);
}
sourcepub fn iter_mut(&mut self) -> IterMut<'_, K, V, S, I>ⓘNotable traits for IterMut<'a, K, V, S, I>impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for IterMut<'a, K, V, S, I> type Item = (&'a K, &'a mut V);
pub fn iter_mut(&mut self) -> IterMut<'_, K, V, S, I>ⓘNotable traits for IterMut<'a, K, V, S, I>impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for IterMut<'a, K, V, S, I> type Item = (&'a K, &'a mut V);
An iterator visiting all key-value pairs in arbitrary order, with
mutable references to the values. The iterator element type is
(&'a K, &'a mut V)
.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
for (_, val) in map.iter_mut() {
*val *= 2;
}
assert_eq!(map.get("a"), Some(&2));
assert_eq!(map.get("b"), Some(&4));
assert_eq!(map.get("c"), Some(&6));
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if the map contains no entries, or false
otherwise.
sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
Returns true
if the map contains the maximum number of entries it can hold, or false
otherwise.
sourcepub fn drain(&mut self) -> Drain<'_, K, V, S, I>ⓘNotable traits for Drain<'a, K, V, S, I>impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for Drain<'a, K, V, S, I> type Item = (K, V);
pub fn drain(&mut self) -> Drain<'_, K, V, S, I>ⓘNotable traits for Drain<'a, K, V, S, I>impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for Drain<'a, K, V, S, I> type Item = (K, V);
Clears the map without taking ownership, and returns all key-value pairs as an iterator.
If the iterator is only partially consumed, or not consumed at all, all remaining key-value pairs will still be removed.
It is unspecified how many pairs will be removed if a panic occurs while
dropping an element, or if the Drain
value is leaked.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
for (k, v) in map.drain().take(1) {
let a = k == "a" && v == 1;
let b = k == "b" && v == 2;
assert!(a || b);
}
assert!(map.is_empty());
sourcepub fn drain_filter<F: FnMut(&K, &mut V) -> bool>(
&mut self,
pred: F
) -> DrainFilter<'_, K, V, S, I, F>ⓘNotable traits for DrainFilter<'a, K, V, S, I, F>impl<'a, K, V, S, I, F> Iterator for DrainFilter<'a, K, V, S, I, F> where
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
F: FnMut(&K, &mut V) -> bool, type Item = (K, V);
pub fn drain_filter<F: FnMut(&K, &mut V) -> bool>(
&mut self,
pred: F
) -> DrainFilter<'_, K, V, S, I, F>ⓘNotable traits for DrainFilter<'a, K, V, S, I, F>impl<'a, K, V, S, I, F> Iterator for DrainFilter<'a, K, V, S, I, F> where
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
F: FnMut(&K, &mut V) -> bool, type Item = (K, V);
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
F: FnMut(&K, &mut V) -> bool, type Item = (K, V);
Creates an iterator which uses a closure to determine if an element should be removed.
If the closure returns true
, the element is removed from the map and
yielded. If the closure returns false
, or panics, the element remains
in the map and will not be yielded.
Note that drain_filter
lets you mutate every value in the filter
closure, regardless of whether you choose to keep or remove it.
If the iterator is only partially consumed, or not consumed at all, all remaining key-value pairs will still be subjected to the closure and removed and dropped if it returns true.
It is unspecified how many pairs will be subjected to the closure if a
panic occurs in the closure, or a panic occurs while dropping an element,
or if the DrainFilter
value is leaked.
Examples
use coca::collections::{InlineListMap, InlineVec};
let mut map = InlineListMap::<u32, u32, 8>::new();
(0..8).for_each(|x| { map.insert(x, x); });
let drained = map.drain_filter(|k, v| { *v = *v * *v; k % 2 == 0 });
let mut evens = InlineVec::<u32, 4>::new();
let mut odds = InlineVec::<u32, 4>::new();
evens.extend(drained.map(|(_x, x_squared)| x_squared));
evens.sort_unstable();
assert_eq!(evens, [0, 4, 16, 36]);
odds.extend(map.into_values());
odds.sort_unstable();
assert_eq!(odds, [1, 9, 25, 49]);
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the map, removing all key-value pairs.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
map.insert("d", 4);
assert!(map.is_full());
map.clear();
assert!(map.is_empty());
sourcepub fn try_entry(&mut self, key: K) -> Result<Entry<'_, K, V, S, I>, K> where
K: Eq,
pub fn try_entry(&mut self, key: K) -> Result<Entry<'_, K, V, S, I>, K> where
K: Eq,
Gets the given key’s corresponding Entry
in the map for in-place manipulation.
Returns [Err(key)
] if the map is full and does not contain the given key.
Examples
use coca::collections::InlineListMap;
let mut letters = InlineListMap::<char, u32, 32>::new();
for ch in "i am, therefore i'm coded".chars() {
let counter = letters.try_entry(ch).unwrap().or_insert(0);
*counter += 1;
}
assert_eq!(letters.get(&'a'), Some(&1));
assert_eq!(letters.get(&'e'), Some(&4));
assert_eq!(letters.get(&'i'), Some(&2));
assert_eq!(letters.get(&'o'), Some(&2));
assert_eq!(letters.get(&'u'), None);
sourcepub fn get<Q>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
pub fn get<Q>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
Returns a reference to the value associated with the given key.
The key may be any borrowed form of the map’s key type,
but Eq
on the borrowed form must match that for the key type.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
assert_eq!(map.get("a"), Some(&1));
assert_eq!(map.get("b"), None);
sourcepub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
Returns the key-value pair corresponding to the given key.
The key may be any borrowed form of the map’s key type,
but Eq
on the borrowed form must match that for the key type.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
assert_eq!(map.get_key_value("a"), Some((&"a", &1)));
assert_eq!(map.get_key_value("b"), None);
sourcepub fn contains_key<Q>(&self, key: &Q) -> bool where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
pub fn contains_key<Q>(&self, key: &Q) -> bool where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
Returns true
if the map contains a value for the given key, or false
otherwise.
The key may be any borrowed form of the map’s key type,
but Eq
on the borrowed form must match that for the key type.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
assert_eq!(map.contains_key("a"), true);
assert_eq!(map.contains_key("b"), false);
sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
Returns a mutable reference to the value associated with the given key.
The key may be any borrowed form of the map’s key type,
but Eq
on the borrowed form must match that for the key type.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
if let Some(x) = map.get_mut(&"a") {
*x = *x + 2;
}
assert_eq!(map.get("a"), Some(&3));
sourcepub fn insert(&mut self, key: K, value: V) -> Option<V> where
K: Eq,
pub fn insert(&mut self, key: K, value: V) -> Option<V> where
K: Eq,
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.
Panics
Panics if the map is full and the given key is not present. See
try_insert
for a checked version that never panics.
sourcepub fn try_insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)> where
K: Eq,
pub fn try_insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)> where
K: Eq,
Inserts a key-value pair into the map.
If the map did not have this key present, Ok(None)
is returned if the
key-value pair is inserted, or [Err((key, value))
] if the map is full.
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.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
assert_eq!(map.try_insert("a", 37), Ok(None));
assert_eq!(map.try_insert("a", 42), Ok(Some(37)));
map.insert("b", 23);
map.insert("c", 19);
map.insert("d", 8);
assert_eq!(map.is_full(), true);
assert_eq!(map.try_insert("e", 0), Err(("e", 0)));
sourcepub fn remove<Q>(&mut self, key: &Q) -> Option<V> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
pub fn remove<Q>(&mut self, key: &Q) -> Option<V> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
Removes a key from the map, returning the value associated with the key if it was previously in the map.
The key may be any borrowed form of the map’s key type,
but Eq
on the borrowed form must match that for the key type.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
assert_eq!(map.remove("a"), Some(1));
assert_eq!(map.remove("a"), None);
sourcepub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)> where
K: Borrow<Q> + Eq,
Q: Eq + ?Sized,
Removes a key from the map, returning the stored key and associated value if the key was previously in the map.
The key may be any borrowed form of the map’s key type,
but Eq
on the borrowed form must match that for the key type.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
assert_eq!(map.remove_entry("a"), Some(("a", 1)));
assert_eq!(map.remove_entry("a"), None);
sourcepub fn retain<F: FnMut(&K, &mut V) -> bool>(&mut self, pred: F)
pub fn retain<F: FnMut(&K, &mut V) -> bool>(&mut self, pred: F)
Retains only the elements specified by the predicate.
In other words, remove all key-value pairs (k, v)
such that pred(&k, &mut v)
returns false
. The elements are visited in arbitrary (and unspecified) order.
Examples
use coca::collections::InlineListMap;
let mut map = InlineListMap::<u32, u32, 8>::new();
(0..8).for_each(|x| { map.insert(x, x*10); });
assert_eq!(map.len(), 8);
map.retain(|&k, _| k % 2 == 0);
assert_eq!(map.len(), 4);
sourcepub fn into_keys(self) -> IntoKeys<K, V, S, I>ⓘNotable traits for IntoKeys<K, V, S, I>impl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for IntoKeys<K, V, S, I> type Item = K;
pub fn into_keys(self) -> IntoKeys<K, V, S, I>ⓘNotable traits for IntoKeys<K, V, S, I>impl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for IntoKeys<K, V, S, I> type Item = K;
Creates a consuming iterator visiting all keys in arbitrary order.
The map cannot be used after calling this. The iterator element type is K
.
Examples
use coca::collections::{InlineListMap, InlineVec};
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
let mut vec = InlineVec::<&'static str, 4>::new();
vec.extend(map.into_keys());
// The keys are visited in arbitrary order,
// so they must be sorted for this test.
vec.sort_unstable();
assert_eq!(vec, ["a", "b", "c"]);
sourcepub fn into_values(self) -> IntoValues<K, V, S, I>ⓘNotable traits for IntoValues<K, V, S, I>impl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for IntoValues<K, V, S, I> type Item = V;
pub fn into_values(self) -> IntoValues<K, V, S, I>ⓘNotable traits for IntoValues<K, V, S, I>impl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> Iterator for IntoValues<K, V, S, I> type Item = V;
Creates a consuming iterator visiting all values in arbitrary order.
The map cannot be used after calling this. The iterator element type is K
.
Examples
use coca::collections::{InlineListMap, InlineVec};
let mut map = InlineListMap::<&'static str, u32, 4>::new();
map.insert("a", 1);
map.insert("b", 2);
map.insert("c", 3);
let mut vec = InlineVec::<u32, 4>::new();
vec.extend(map.into_values());
// The values are visited in arbitrary order,
// so they must be sorted for this test.
vec.sort_unstable();
assert_eq!(vec, [1, 2, 3]);
sourceimpl<K, V, I: Capacity> ListMap<K, V, AllocStorage<ListMapLayout<K, V>>, I>
impl<K, V, I: Capacity> ListMap<K, V, AllocStorage<ListMapLayout<K, V>>, I>
sourcepub fn with_capacity(capacity: usize) -> Self
This is supported on crate feature alloc
only.
pub fn with_capacity(capacity: usize) -> Self
alloc
only.Constructs a new, empty AllocListMap
with the specified capacity.
sourceimpl<K, V, I: Capacity, const N: usize> ListMap<K, V, InlineStorage<K, V, N>, I>
impl<K, V, I: Capacity, const N: usize> ListMap<K, V, InlineStorage<K, V, N>, I>
sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new, empty InlineListMap
.
Trait Implementations
sourceimpl<K: Clone, V: Clone, I: Capacity, const N: usize> Clone for ListMap<K, V, InlineStorage<K, V, N>, I>
impl<K: Clone, V: Clone, I: Capacity, const N: usize> Clone for ListMap<K, V, InlineStorage<K, V, N>, I>
sourceimpl<K: Debug, V: Debug, S: Storage<ListMapLayout<K, V>>, I: Capacity> Debug for ListMap<K, V, S, I>
impl<K: Debug, V: Debug, S: Storage<ListMapLayout<K, V>>, I: Capacity> Debug for ListMap<K, V, S, I>
sourceimpl<'a, K, V, S, I> Extend<(&'a K, &'a V)> for ListMap<K, V, S, I> where
K: Clone + Eq,
V: Clone,
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
impl<'a, K, V, S, I> Extend<(&'a K, &'a V)> for ListMap<K, V, S, I> where
K: Clone + Eq,
V: Clone,
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
sourcefn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<K, V, S, I> Extend<(K, V)> for ListMap<K, V, S, I> where
K: Eq,
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
impl<K, V, S, I> Extend<(K, V)> for ListMap<K, V, S, I> where
K: Eq,
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
sourcefn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<Q, K, V, S, I> Index<&'_ Q> for ListMap<K, V, S, I> where
Q: Eq + ?Sized,
K: Eq + Borrow<Q>,
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
impl<Q, K, V, S, I> Index<&'_ Q> for ListMap<K, V, S, I> where
Q: Eq + ?Sized,
K: Eq + Borrow<Q>,
S: Storage<ListMapLayout<K, V>>,
I: Capacity,
sourceimpl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> IntoIterator for &'a ListMap<K, V, S, I>
impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> IntoIterator for &'a ListMap<K, V, S, I>
sourceimpl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> IntoIterator for &'a mut ListMap<K, V, S, I>
impl<'a, K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> IntoIterator for &'a mut ListMap<K, V, S, I>
sourceimpl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> IntoIterator for ListMap<K, V, S, I>
impl<K, V, S: Storage<ListMapLayout<K, V>>, I: Capacity> IntoIterator for ListMap<K, V, S, I>
sourceimpl<K, V, S1, I1, S2, I2> PartialEq<ListMap<K, V, S2, I2>> for ListMap<K, V, S1, I1> where
K: Eq,
V: PartialEq,
S1: Storage<ListMapLayout<K, V>>,
S2: Storage<ListMapLayout<K, V>>,
I1: Capacity,
I2: Capacity,
impl<K, V, S1, I1, S2, I2> PartialEq<ListMap<K, V, S2, I2>> for ListMap<K, V, S1, I1> where
K: Eq,
V: PartialEq,
S1: Storage<ListMapLayout<K, V>>,
S2: Storage<ListMapLayout<K, V>>,
I1: Capacity,
I2: Capacity,
impl<K: Eq, V: Eq, S: Storage<ListMapLayout<K, V>>, I: Capacity> Eq for ListMap<K, V, S, I>
Auto Trait Implementations
impl<K, V, S, I> RefUnwindSafe for ListMap<K, V, S, I> where
I: RefUnwindSafe,
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, S, I> Send for ListMap<K, V, S, I> where
I: Send,
K: Send,
S: Send,
V: Send,
impl<K, V, S, I> Sync for ListMap<K, V, S, I> where
I: Sync,
K: Sync,
S: Sync,
V: Sync,
impl<K, V, S, I> Unpin for ListMap<K, V, S, I> where
I: Unpin,
K: Unpin,
S: Unpin,
V: Unpin,
impl<K, V, S, I> UnwindSafe for ListMap<K, V, S, I> where
I: UnwindSafe,
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more