pub struct LiteMap<K: ?Sized, V: ?Sized, S = Vec<(K, V)>> { /* private fields */ }
Expand description
A simple “flat” map based on a sorted vector
See the module level documentation for why one should use this.
The API is roughly similar to that of std::collections::BTreeMap
.
Implementations§
source§impl<K, V, S> LiteMap<K, V, S>
impl<K, V, S> LiteMap<K, V, S>
sourcepub const fn from_sorted_store_unchecked(values: S) -> Self
pub const fn from_sorted_store_unchecked(values: S) -> Self
Construct a new LiteMap
using the given values
The store must be sorted and have no duplicate keys.
source§impl<K, V> LiteMap<K, V, Vec<(K, V)>>
impl<K, V> LiteMap<K, V, Vec<(K, V)>>
sourcepub fn into_tuple_vec(self) -> Vec<(K, V)>
pub fn into_tuple_vec(self) -> Vec<(K, V)>
Convert a LiteMap
into a sorted Vec<(K, V)>
.
source§impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>where
S: Store<K, V>,
impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>where
S: Store<K, V>,
sourcepub fn get_indexed(&self, index: usize) -> Option<(&K, &V)>
pub fn get_indexed(&self, index: usize) -> Option<(&K, &V)>
Get the key-value pair residing at a particular index
In most cases, prefer LiteMap::get()
over this method.
sourcepub fn first(&self) -> Option<(&K, &V)>
pub fn first(&self) -> Option<(&K, &V)>
Get the lowest-rank key/value pair from the LiteMap
, if it exists.
§Examples
use litemap::LiteMap;
let mut map =
LiteMap::<i32, &str, Vec<_>>::from_iter([(1, "uno"), (3, "tres")]);
assert_eq!(map.first(), Some((&1, &"uno")));
sourcepub fn last(&self) -> Option<(&K, &V)>
pub fn last(&self) -> Option<(&K, &V)>
Get the highest-rank key/value pair from the LiteMap
, if it exists.
§Examples
use litemap::LiteMap;
let mut map =
LiteMap::<i32, &str, Vec<_>>::from_iter([(1, "uno"), (3, "tres")]);
assert_eq!(map.last(), Some((&3, &"tres")));
sourcepub fn to_boxed_keys_values<KB: ?Sized, VB: ?Sized, SB>(
&self,
) -> LiteMap<Box<KB>, Box<VB>, SB>
pub fn to_boxed_keys_values<KB: ?Sized, VB: ?Sized, SB>( &self, ) -> LiteMap<Box<KB>, Box<VB>, SB>
Returns a new LiteMap
with owned keys and values.
The trait bounds allow transforming most slice and string types.
§Examples
use litemap::LiteMap;
let mut map: LiteMap<&str, &str> = LiteMap::new_vec();
map.insert("one", "uno");
map.insert("two", "dos");
let boxed_map: LiteMap<Box<str>, Box<str>> = map.to_boxed_keys_values();
assert_eq!(boxed_map.get("one"), Some(&Box::from("uno")));
sourcepub fn to_boxed_keys<KB: ?Sized, SB>(&self) -> LiteMap<Box<KB>, V, SB>
pub fn to_boxed_keys<KB: ?Sized, SB>(&self) -> LiteMap<Box<KB>, V, SB>
Returns a new LiteMap
with owned keys and cloned values.
The trait bounds allow transforming most slice and string types.
§Examples
use litemap::LiteMap;
let mut map: LiteMap<&str, usize> = LiteMap::new_vec();
map.insert("one", 11);
map.insert("two", 22);
let boxed_map: LiteMap<Box<str>, usize> = map.to_boxed_keys();
assert_eq!(boxed_map.get("one"), Some(&11));
sourcepub fn to_boxed_values<VB: ?Sized, SB>(&self) -> LiteMap<K, Box<VB>, SB>
pub fn to_boxed_values<VB: ?Sized, SB>(&self) -> LiteMap<K, Box<VB>, SB>
Returns a new LiteMap
with cloned keys and owned values.
The trait bounds allow transforming most slice and string types.
§Examples
use litemap::LiteMap;
let mut map: LiteMap<usize, &str> = LiteMap::new_vec();
map.insert(11, "uno");
map.insert(22, "dos");
let boxed_map: LiteMap<usize, Box<str>> = map.to_boxed_values();
assert_eq!(boxed_map.get(&11), Some(&Box::from("uno")));
source§impl<K, V: ?Sized, S> LiteMap<K, V, S>
impl<K, V: ?Sized, S> LiteMap<K, V, S>
sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Get the value associated with key
, if it exists.
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
assert_eq!(map.get(&1), Some(&"one"));
assert_eq!(map.get(&3), None);
sourcepub fn get_by(&self, predicate: impl FnMut(&K) -> Ordering) -> Option<&V>
pub fn get_by(&self, predicate: impl FnMut(&K) -> Ordering) -> Option<&V>
Binary search the map with predicate
to find a key, returning the value.
sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Returns whether key
is contained in this map
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
assert!(map.contains_key(&1));
assert!(!map.contains_key(&3));
sourcepub fn find_index<Q>(&self, key: &Q) -> Result<usize, usize>
pub fn find_index<Q>(&self, key: &Q) -> Result<usize, usize>
Obtain the index for a given key, or if the key is not found, the index at which it would be inserted.
(The return value works equivalently to slice::binary_search_by()
)
The indices returned can be used with Self::get_indexed()
. Prefer using
Self::get()
directly where possible.
source§impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>where
S: StoreSlice<K, V>,
impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>where
S: StoreSlice<K, V>,
sourcepub fn get_indexed_range(
&self,
range: Range<usize>,
) -> Option<LiteMap<K, V, &S::Slice>>
pub fn get_indexed_range( &self, range: Range<usize>, ) -> Option<LiteMap<K, V, &S::Slice>>
Creates a new LiteMap
from a range of the current LiteMap
.
§Examples
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
map.insert(3, "three");
let mut sub_map = map.get_indexed_range(1..3).expect("valid range");
assert_eq!(sub_map.get(&1), None);
assert_eq!(sub_map.get(&2), Some(&"two"));
assert_eq!(sub_map.get(&3), Some(&"three"));
sourcepub fn as_sliced(&self) -> LiteMap<K, V, &S::Slice>
pub fn as_sliced(&self) -> LiteMap<K, V, &S::Slice>
Borrows this LiteMap
as one of its slice type.
This can be useful in situations where you need a LiteMap
by value but do not want
to clone the owned version.
§Examples
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
let borrowed_map = map.as_sliced();
assert_eq!(borrowed_map.get(&1), Some(&"one"));
assert_eq!(borrowed_map.get(&2), Some(&"two"));
source§impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>where
S: Store<K, V>,
impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>where
S: Store<K, V>,
sourcepub fn to_borrowed_keys_values<KB: ?Sized, VB: ?Sized, SB>(
&'a self,
) -> LiteMap<&'a KB, &'a VB, SB>
pub fn to_borrowed_keys_values<KB: ?Sized, VB: ?Sized, SB>( &'a self, ) -> LiteMap<&'a KB, &'a VB, SB>
Returns a new LiteMap
with keys and values borrowed from this one.
§Examples
use litemap::LiteMap;
let mut map: LiteMap<Box<usize>, String> = LiteMap::new_vec();
map.insert(Box::new(1), "one".to_string());
map.insert(Box::new(2), "two".to_string());
let borrowed_map: LiteMap<&usize, &str> = map.to_borrowed_keys_values();
assert_eq!(borrowed_map.get(&1), Some(&"one"));
sourcepub fn to_borrowed_keys<KB: ?Sized, SB>(&'a self) -> LiteMap<&'a KB, V, SB>
pub fn to_borrowed_keys<KB: ?Sized, SB>(&'a self) -> LiteMap<&'a KB, V, SB>
Returns a new LiteMap
with keys borrowed from this one and cloned values.
§Examples
use litemap::LiteMap;
let mut map: LiteMap<Box<usize>, String> = LiteMap::new_vec();
map.insert(Box::new(1), "one".to_string());
map.insert(Box::new(2), "two".to_string());
let borrowed_map: LiteMap<&usize, String> = map.to_borrowed_keys();
assert_eq!(borrowed_map.get(&1), Some(&"one".to_string()));
sourcepub fn to_borrowed_values<VB: ?Sized, SB>(&'a self) -> LiteMap<K, &'a VB, SB>
pub fn to_borrowed_values<VB: ?Sized, SB>(&'a self) -> LiteMap<K, &'a VB, SB>
Returns a new LiteMap
with values borrowed from this one and cloned keys.
§Examples
use litemap::LiteMap;
let mut map: LiteMap<Box<usize>, String> = LiteMap::new_vec();
map.insert(Box::new(1), "one".to_string());
map.insert(Box::new(2), "two".to_string());
let borrowed_map: LiteMap<Box<usize>, &str> = map.to_borrowed_values();
assert_eq!(borrowed_map.get(&1), Some(&"one"));
source§impl<K, V, S> LiteMap<K, V, S>where
S: StoreMut<K, V>,
impl<K, V, S> LiteMap<K, V, S>where
S: StoreMut<K, V>,
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Construct a new LiteMap
with a given capacity
sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserve capacity for additional
more elements to be inserted into
the LiteMap
to avoid frequent reallocations.
See Vec::reserve()
for more information.
source§impl<K, V, S> LiteMap<K, V, S>
impl<K, V, S> LiteMap<K, V, S>
sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Get the value associated with key
, if it exists, as a mutable reference.
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
if let Some(mut v) = map.get_mut(&1) {
*v = "uno";
}
assert_eq!(map.get(&1), Some(&"uno"));
sourcepub fn try_append(&mut self, key: K, value: V) -> Option<(K, V)>
pub fn try_append(&mut self, key: K, value: V) -> Option<(K, V)>
Appends value
with key
to the end of the underlying vector, returning
key
and value
if it failed. Useful for extending with an existing
sorted list.
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
assert!(map.try_append(1, "uno").is_none());
assert!(map.try_append(3, "tres").is_none());
assert!(
matches!(map.try_append(3, "tres-updated"), Some((3, "tres-updated"))),
"append duplicate of last key",
);
assert!(
matches!(map.try_append(2, "dos"), Some((2, "dos"))),
"append out of order"
);
assert_eq!(map.get(&1), Some(&"uno"));
// contains the original value for the key: 3
assert_eq!(map.get(&3), Some(&"tres"));
// not appended since it wasn't in order
assert_eq!(map.get(&2), None);
sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Insert value
with key
, returning the existing value if it exists.
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
assert_eq!(map.get(&1), Some(&"one"));
assert_eq!(map.get(&3), None);
sourcepub fn try_insert(&mut self, key: K, value: V) -> Option<(K, V)>
pub fn try_insert(&mut self, key: K, value: V) -> Option<(K, V)>
Attempts to insert a unique entry into the map.
If key
is not already in the map, inserts it with the corresponding value
and returns None
.
If key
is already in the map, no change is made to the map, and the key and value
are returned back to the caller.
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(3, "three");
// 2 is not yet in the map...
assert_eq!(map.try_insert(2, "two"), None);
assert_eq!(map.len(), 3);
// ...but now it is.
assert_eq!(map.try_insert(2, "TWO"), Some((2, "TWO")));
assert_eq!(map.len(), 3);
sourcepub fn try_get_or_insert<E>(
&mut self,
key: K,
value: impl FnOnce(&K) -> Result<V, E>,
) -> Result<(usize, &V), E>
pub fn try_get_or_insert<E>( &mut self, key: K, value: impl FnOnce(&K) -> Result<V, E>, ) -> Result<(usize, &V), E>
Attempts to insert a unique entry into the map.
If key
is not already in the map, invokes the closure to compute value
, inserts
the pair into the map, and returns a reference to the value. The closure is passed
a reference to the key
argument.
If key
is already in the map, a reference to the existing value is returned.
Additionally, the index of the value in the map is returned. If it is not desirable
to hold on to the mutable reference’s lifetime, the index can be used to access the
element via LiteMap::get_indexed()
.
The closure returns a Result
to allow for a fallible insertion function. If the
creation of value
is infallible, you can use core::convert::Infallible
.
use litemap::LiteMap;
/// Helper function to unwrap an `Infallible` result from the insertion function
fn unwrap_infallible<T>(result: Result<T, core::convert::Infallible>) -> T {
result.unwrap_or_else(|never| match never {})
}
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(3, "three");
// 2 is not yet in the map...
let result1 = unwrap_infallible(
map.try_get_or_insert(2, |_| Ok("two"))
);
assert_eq!(result1.1, &"two");
assert_eq!(map.len(), 3);
// ...but now it is.
let result1 = unwrap_infallible(
map.try_get_or_insert(2, |_| Ok("TWO"))
);
assert_eq!(result1.1, &"two");
assert_eq!(map.len(), 3);
source§impl<K, V, S> LiteMap<K, V, S>
impl<K, V, S> LiteMap<K, V, S>
sourcepub fn extend_from_litemap(&mut self, other: Self) -> Option<Self>
pub fn extend_from_litemap(&mut self, other: Self) -> Option<Self>
Insert all elements from other
into this LiteMap
.
If other
contains keys that already exist in self
, the values in other
replace the
corresponding ones in self
, and the rejected items from self
are returned as a new
LiteMap
. Otherwise, None
is returned.
The implementation of this function is optimized if self
and other
have no overlap.
§Examples
use litemap::LiteMap;
let mut map1 = LiteMap::new_vec();
map1.insert(1, "one");
map1.insert(2, "two");
let mut map2 = LiteMap::new_vec();
map2.insert(2, "TWO");
map2.insert(4, "FOUR");
let leftovers = map1.extend_from_litemap(map2);
assert_eq!(map1.len(), 3);
assert_eq!(map1.get(&1), Some("one").as_ref());
assert_eq!(map1.get(&2), Some("TWO").as_ref());
assert_eq!(map1.get(&4), Some("FOUR").as_ref());
let map3 = leftovers.expect("Duplicate keys");
assert_eq!(map3.len(), 1);
assert_eq!(map3.get(&2), Some("two").as_ref());
source§impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>where
S: StoreIterable<'a, K, V>,
impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>where
S: StoreIterable<'a, K, V>,
sourcepub fn iter(&'a self) -> impl DoubleEndedIterator<Item = (&'a K, &'a V)>
pub fn iter(&'a self) -> impl DoubleEndedIterator<Item = (&'a K, &'a V)>
Produce an ordered iterator over key-value pairs
sourcepub fn iter_keys(&'a self) -> impl DoubleEndedIterator<Item = &'a K>
👎Deprecated: use keys() instead
pub fn iter_keys(&'a self) -> impl DoubleEndedIterator<Item = &'a K>
Produce an ordered iterator over keys
sourcepub fn iter_values(&'a self) -> impl DoubleEndedIterator<Item = &'a V>
👎Deprecated: use values() instead
pub fn iter_values(&'a self) -> impl DoubleEndedIterator<Item = &'a V>
Produce an iterator over values, ordered by their keys
sourcepub fn keys(&'a self) -> impl DoubleEndedIterator<Item = &'a K>
pub fn keys(&'a self) -> impl DoubleEndedIterator<Item = &'a K>
Produce an ordered iterator over keys
sourcepub fn values(&'a self) -> impl DoubleEndedIterator<Item = &'a V>
pub fn values(&'a self) -> impl DoubleEndedIterator<Item = &'a V>
Produce an iterator over values, ordered by their keys
source§impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>where
S: StoreIterableMut<'a, K, V>,
impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>where
S: StoreIterableMut<'a, K, V>,
sourcepub fn iter_mut(
&'a mut self,
) -> impl DoubleEndedIterator<Item = (&'a K, &'a mut V)>
pub fn iter_mut( &'a mut self, ) -> impl DoubleEndedIterator<Item = (&'a K, &'a mut V)>
Produce an ordered mutable iterator over key-value pairs
source§impl<K, V, S> LiteMap<K, V, S>where
S: StoreMut<K, V>,
impl<K, V, S> LiteMap<K, V, S>where
S: StoreMut<K, V>,
sourcepub fn retain<F>(&mut self, predicate: F)
pub fn retain<F>(&mut self, predicate: F)
Retains only the elements specified by the predicate.
In other words, remove all elements such that f((&k, &v))
returns false
.
§Example
use litemap::LiteMap;
let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
map.insert(3, "three");
// Retain elements with odd keys
map.retain(|k, _| k % 2 == 1);
assert_eq!(map.get(&1), Some(&"one"));
assert_eq!(map.get(&2), None);
source§impl<'a, K, V> LiteMap<K, V, &'a [(K, V)]>
impl<'a, K, V> LiteMap<K, V, &'a [(K, V)]>
sourcepub const fn const_len(&self) -> usize
pub const fn const_len(&self) -> usize
Const version of LiteMap::len()
for a slice store.
Note: This function will no longer be needed if const trait behavior is stabilized.
§Examples
use litemap::LiteMap;
static map: LiteMap<&str, usize, &[(&str, usize)]> =
LiteMap::from_sorted_store_unchecked(&[("a", 11), ("b", 22)]);
static len: usize = map.const_len();
assert_eq!(len, 2);
sourcepub const fn const_is_empty(&self) -> bool
pub const fn const_is_empty(&self) -> bool
Const version of LiteMap::is_empty()
for a slice store.
Note: This function will no longer be needed if const trait behavior is stabilized.
§Examples
use litemap::LiteMap;
static map: LiteMap<&str, usize, &[(&str, usize)]> =
LiteMap::from_sorted_store_unchecked(&[]);
static is_empty: bool = map.const_is_empty();
assert!(is_empty);
sourcepub const fn const_get_indexed_or_panic(&self, index: usize) -> &'a (K, V)
pub const fn const_get_indexed_or_panic(&self, index: usize) -> &'a (K, V)
Const version of LiteMap::get_indexed()
for a slice store.
Note: This function will no longer be needed if const trait behavior is stabilized.
§Panics
Panics if the index is out of bounds.
§Examples
use litemap::LiteMap;
static map: LiteMap<&str, usize, &[(&str, usize)]> =
LiteMap::from_sorted_store_unchecked(&[("a", 11), ("b", 22)]);
static t: &(&str, usize) = map.const_get_indexed_or_panic(0);
assert_eq!(t.0, "a");
assert_eq!(t.1, 11);
source§impl<'a, V> LiteMap<&'a str, V, &'a [(&'a str, V)]>
impl<'a, V> LiteMap<&'a str, V, &'a [(&'a str, V)]>
sourcepub const fn const_get_with_index(&self, key: &str) -> Option<(usize, &'a V)>
pub const fn const_get_with_index(&self, key: &str) -> Option<(usize, &'a V)>
Const function to get the value associated with a &str
key, if it exists.
Also returns the index of the value.
Note: This function will no longer be needed if const trait behavior is stabilized.
§Examples
use litemap::LiteMap;
static map: LiteMap<&str, usize, &[(&str, usize)]> =
LiteMap::from_sorted_store_unchecked(&[
("abc", 11),
("bcd", 22),
("cde", 33),
("def", 44),
("efg", 55),
]);
static d: Option<(usize, &usize)> = map.const_get_with_index("def");
assert_eq!(d, Some((3, &44)));
static n: Option<(usize, &usize)> = map.const_get_with_index("dng");
assert_eq!(n, None);
source§impl<'a, V> LiteMap<&'a [u8], V, &'a [(&'a [u8], V)]>
impl<'a, V> LiteMap<&'a [u8], V, &'a [(&'a [u8], V)]>
sourcepub const fn const_get_with_index(&self, key: &[u8]) -> Option<(usize, &'a V)>
pub const fn const_get_with_index(&self, key: &[u8]) -> Option<(usize, &'a V)>
Const function to get the value associated with a &[u8]
key, if it exists.
Also returns the index of the value.
Note: This function will no longer be needed if const trait behavior is stabilized.
§Examples
use litemap::LiteMap;
static map: LiteMap<&[u8], usize, &[(&[u8], usize)]> =
LiteMap::from_sorted_store_unchecked(&[
(b"abc", 11),
(b"bcd", 22),
(b"cde", 33),
(b"def", 44),
(b"efg", 55),
]);
static d: Option<(usize, &usize)> = map.const_get_with_index(b"def");
assert_eq!(d, Some((3, &44)));
static n: Option<(usize, &usize)> = map.const_get_with_index(b"dng");
assert_eq!(n, None);
Trait Implementations§
source§impl<K, V, S> Bake for LiteMap<K, V, S>where
S: Bake,
impl<K, V, S> Bake for LiteMap<K, V, S>where
S: Bake,
Bakes a LiteMap into Rust code for fast runtime construction from data. Use this impl during
code generation, such as in a build.rs
script.
For the most efficient bake, bake the LiteMap
with a slice store. Use functions such as
the following for converting an allocated LiteMap
to a borrowing LiteMap
:
LiteMap::to_borrowed_keys()
LiteMap::to_borrowed_values()
LiteMap::to_borrowed_keys_values()
LiteMap::as_sliced()
§Examples
use databake::*;
use litemap::LiteMap;
// Construct the LiteMap fully owned and allocated:
let mut litemap_alloc: LiteMap<usize, String, Vec<_>> = LiteMap::new_vec();
litemap_alloc.insert(1usize, "one".to_string());
litemap_alloc.insert(2usize, "two".to_string());
litemap_alloc.insert(10usize, "ten".to_string());
// Convert to a borrowed type for baking:
let litemap_str: LiteMap<usize, &str, Vec<_>> =
litemap_alloc.to_borrowed_values();
let litemap_slice: LiteMap<usize, &str, &[_]> = litemap_str.as_sliced();
// The bake will now work for const construction:
let mut ctx = Default::default();
println!(
"const FOO: LiteMap<usize, &str, &[(usize, &str)]> = {};",
litemap_slice.bake(&mut ctx)
);
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
source§impl<'de, K, V, R> Deserialize<'de> for LiteMap<K, V, R>
impl<'de, K, V, R> Deserialize<'de> for LiteMap<K, V, R>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl<K, V, S> FromIterator<(K, V)> for LiteMap<K, V, S>where
K: Ord,
S: StoreFromIterable<K, V>,
impl<K, V, S> FromIterator<(K, V)> for LiteMap<K, V, S>where
K: Ord,
S: StoreFromIterable<K, V>,
source§impl<'a, K, V, S> IntoIterator for &'a LiteMap<K, V, S>where
S: StoreIterable<'a, K, V>,
impl<'a, K, V, S> IntoIterator for &'a LiteMap<K, V, S>where
S: StoreIterable<'a, K, V>,
source§impl<'a, K, V, S> IntoIterator for &'a mut LiteMap<K, V, S>where
S: StoreIterableMut<'a, K, V>,
impl<'a, K, V, S> IntoIterator for &'a mut LiteMap<K, V, S>where
S: StoreIterableMut<'a, K, V>,
source§impl<K, V, S> IntoIterator for LiteMap<K, V, S>where
S: StoreIntoIterator<K, V>,
impl<K, V, S> IntoIterator for LiteMap<K, V, S>where
S: StoreIntoIterator<K, V>,
source§impl<K: Ord + ?Sized, V: Ord + ?Sized, S: Ord> Ord for LiteMap<K, V, S>
impl<K: Ord + ?Sized, V: Ord + ?Sized, S: Ord> Ord for LiteMap<K, V, S>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<K: PartialEq + ?Sized, V: PartialEq + ?Sized, S: PartialEq> PartialEq for LiteMap<K, V, S>
impl<K: PartialEq + ?Sized, V: PartialEq + ?Sized, S: PartialEq> PartialEq for LiteMap<K, V, S>
source§impl<K: PartialOrd + ?Sized, V: PartialOrd + ?Sized, S: PartialOrd> PartialOrd for LiteMap<K, V, S>
impl<K: PartialOrd + ?Sized, V: PartialOrd + ?Sized, S: PartialOrd> PartialOrd for LiteMap<K, V, S>
source§impl<'a, K, V, S> Yokeable<'a> for LiteMap<K, V, S>
impl<'a, K, V, S> Yokeable<'a> for LiteMap<K, V, S>
source§type Output = LiteMap<K, V, S>
type Output = LiteMap<K, V, S>
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
Self<'a>
’s lifetime. Read moresource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreimpl<K: Eq + ?Sized, V: Eq + ?Sized, S: Eq> Eq for LiteMap<K, V, S>
impl<K: ?Sized, V: ?Sized, S> StructuralPartialEq for LiteMap<K, V, S>
Auto Trait Implementations§
impl<K, V, S> Freeze for LiteMap<K, V, S>
impl<K, V, S> RefUnwindSafe for LiteMap<K, V, S>
impl<K, V, S> Send for LiteMap<K, V, S>
impl<K, V, S> Sync for LiteMap<K, V, S>
impl<K, V, S> Unpin for LiteMap<K, V, S>
impl<K, V, S> UnwindSafe for LiteMap<K, V, S>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)