Struct LiteMap

struct LiteMap<K: ?Sized, V: ?Sized, S = alloc::vec::Vec<(K, V)>> { ... }

A simple "flat" map based on a sorted vector

See the [module level documentation][super] for why one should use this.

The API is roughly similar to that of std::collections::BTreeMap.

Implementations

impl<'a, K, V> LiteMap<K, V, &'a [(K, V)]>

const fn const_len(self: &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);
const fn const_is_empty(self: &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);
const fn const_get_indexed_or_panic(self: &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);

impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>

fn iter_mut(self: &'a mut Self) -> impl DoubleEndedIterator<Item = (&'a K, &'a mut V)>

Produce an ordered mutable iterator over key-value pairs

impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>

fn to_borrowed_keys_values<KB: ?Sized, VB: ?Sized, SB>(self: &'a Self) -> LiteMap<&'a KB, &'a VB, SB>
where
    K: Borrow<KB>,
    V: Borrow<VB>,
    SB: StoreMut<&'a KB, &'a VB>

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"));
fn to_borrowed_keys<KB: ?Sized, SB>(self: &'a Self) -> LiteMap<&'a KB, V, SB>
where
    K: Borrow<KB>,
    V: Clone,
    SB: StoreMut<&'a KB, V>

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()));
fn to_borrowed_values<VB: ?Sized, SB>(self: &'a Self) -> LiteMap<K, &'a VB, SB>
where
    K: Clone,
    V: Borrow<VB>,
    SB: StoreMut<K, &'a VB>

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"));

impl<'a, K: 'a, V: 'a, S> LiteMap<K, V, S>

fn iter(self: &'a Self) -> impl DoubleEndedIterator<Item = (&'a K, &'a V)>

Produce an ordered iterator over key-value pairs

fn iter_keys(self: &'a Self) -> impl DoubleEndedIterator<Item = &'a K>

Produce an ordered iterator over keys

fn iter_values(self: &'a Self) -> impl DoubleEndedIterator<Item = &'a V>

Produce an iterator over values, ordered by their keys

fn keys(self: &'a Self) -> impl DoubleEndedIterator<Item = &'a K>

Produce an ordered iterator over keys

fn values(self: &'a Self) -> impl DoubleEndedIterator<Item = &'a V>

Produce an iterator over values, ordered by their keys

impl<'a, V> LiteMap<&'a [u8], V, &'a [(&'a [u8], V)]>

const fn const_get_with_index(self: &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);

impl<'a, V> LiteMap<&'a str, V, &'a [(&'a str, V)]>

const fn const_get_with_index(self: &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);

impl<'a, V> LiteMap<i128, V, &'a [(i128, V)]>

const fn const_get_with_index(self: &Self, key: i128) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<i16, V, &'a [(i16, V)]>

const fn const_get_with_index(self: &Self, key: i16) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<i32, V, &'a [(i32, V)]>

const fn const_get_with_index(self: &Self, key: i32) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<i64, V, &'a [(i64, V)]>

const fn const_get_with_index(self: &Self, key: i64) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<i8, V, &'a [(i8, V)]>

const fn const_get_with_index(self: &Self, key: i8) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<isize, V, &'a [(isize, V)]>

const fn const_get_with_index(self: &Self, key: isize) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<u128, V, &'a [(u128, V)]>

const fn const_get_with_index(self: &Self, key: u128) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<u16, V, &'a [(u16, V)]>

const fn const_get_with_index(self: &Self, key: u16) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<u32, V, &'a [(u32, V)]>

const fn const_get_with_index(self: &Self, key: u32) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<u64, V, &'a [(u64, V)]>

const fn const_get_with_index(self: &Self, key: u64) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<u8, V, &'a [(u8, V)]>

const fn const_get_with_index(self: &Self, key: u8) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<'a, V> LiteMap<usize, V, &'a [(usize, V)]>

const fn const_get_with_index(self: &Self, key: usize) -> Option<(usize, &'a V)>

Const function to get the value associated with an integer key, if it exists.

Note: This function will no longer be needed if const trait behavior is stabilized.

Also returns the index of the value.

impl<K, V> LiteMap<K, V>

const fn new_vec() -> Self

Construct a new LiteMap backed by Vec

impl<K, V> LiteMap<K, V, Vec<(K, V)>>

fn into_tuple_vec(self: Self) -> Vec<(K, V)>

Convert a LiteMap into a sorted Vec<(K, V)>.

impl<K, V, S> LiteMap<K, V, S>

fn entry(self: &mut Self, key: K) -> Entry<'_, K, V, S>

Gets the entry for the given key in the map for in-place manipulation.

impl<K, V, S> LiteMap<K, V, S>

fn extend_from_litemap(self: &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());

impl<K, V, S> LiteMap<K, V, S>

fn get_mut<Q>(self: &mut Self, key: &Q) -> Option<&mut V>
where
    K: Borrow<Q>,
    Q: Ord + ?Sized

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"));
fn try_append(self: &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);
fn insert(self: &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);
fn try_insert(self: &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);
fn try_get_or_insert<E, impl FnOnce(&K) -> Result<V, E>: FnOnce(&K) -> Result<V, E>>(self: &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);
fn remove<Q>(self: &mut Self, key: &Q) -> Option<V>
where
    K: Borrow<Q>,
    Q: Ord + ?Sized

Remove the value at key, returning it if it exists.

use litemap::LiteMap;

let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");
assert_eq!(map.remove(&1), Some("one"));
assert_eq!(map.get(&1), None);

impl<K, V, S> LiteMap<K, V, S>

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.

impl<K, V, S> LiteMap<K, V, S>

fn retain<F>(self: &mut Self, predicate: F)
where
    F: FnMut(&K, &V) -> bool

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);

impl<K, V, S> LiteMap<K, V, S>

fn with_capacity(capacity: usize) -> Self

Construct a new LiteMap with a given capacity

fn clear(self: &mut Self)

Remove all elements from the LiteMap

fn reserve(self: &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.

impl<K, V: ?Sized, S> LiteMap<K, V, S>

fn get<Q>(self: &Self, key: &Q) -> Option<&V>
where
    K: Borrow<Q>,
    Q: Ord + ?Sized

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);
fn get_by<impl FnMut(&K) -> Ordering: FnMut(&K) -> Ordering>(self: &Self, predicate: impl FnMut(&K) -> Ordering) -> Option<&V>

Binary search the map with predicate to find a key, returning the value.

fn contains_key<Q>(self: &Self, key: &Q) -> bool
where
    K: Borrow<Q>,
    Q: Ord + ?Sized

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));
fn find_index<Q>(self: &Self, key: &Q) -> Result<usize, usize>
where
    K: Borrow<Q>,
    Q: Ord + ?Sized

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.

impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>

fn get_indexed_range(self: &Self, range: Range<usize>) -> Option<LiteMap<K, V, &<S as >::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"));
fn as_sliced(self: &Self) -> LiteMap<K, V, &<S as >::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"));
fn as_slice(self: &Self) -> &<S as >::Slice

Borrows the backing buffer of this LiteMap as its slice type.

The slice will be sorted.

Examples

use litemap::LiteMap;

let mut map = LiteMap::new_vec();
map.insert(1, "one");
map.insert(2, "two");

let slice = map.as_slice();
assert_eq!(slice, &[(1, "one"), (2, "two")]);

impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>

const fn new() -> Self

Create a new empty LiteMap

impl<K: ?Sized, V: ?Sized, S> LiteMap<K, V, S>

fn len(self: &Self) -> usize

The number of elements in the LiteMap

fn is_empty(self: &Self) -> bool

Whether the LiteMap is empty

fn get_indexed(self: &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.

fn first(self: &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")));
fn last(self: &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")));
fn to_boxed_keys_values<KB: ?Sized, VB: ?Sized, SB>(self: &Self) -> LiteMap<Box<KB>, Box<VB>, SB>
where
    SB: StoreMut<Box<KB>, Box<VB>>,
    K: Borrow<KB>,
    V: Borrow<VB>,
    Box<KB>: for<'a> From<&'a KB>,
    Box<VB>: for<'a> From<&'a VB>

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")));
fn to_boxed_keys<KB: ?Sized, SB>(self: &Self) -> LiteMap<Box<KB>, V, SB>
where
    V: Clone,
    SB: StoreMut<Box<KB>, V>,
    K: Borrow<KB>,
    Box<KB>: for<'a> From<&'a KB>

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));
fn to_boxed_values<VB: ?Sized, SB>(self: &Self) -> LiteMap<K, Box<VB>, SB>
where
    K: Clone,
    SB: StoreMut<K, Box<VB>>,
    V: Borrow<VB>,
    Box<VB>: for<'a> From<&'a VB>

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")));

impl<K, V, S> Default for LiteMap<K, V, S>

fn default() -> Self

impl<K, V, S> Extend for LiteMap<K, V, S>

fn extend<T: IntoIterator<Item = (K, V)>>(self: &mut Self, iter: T)

impl<K, V, S> Freeze for LiteMap<K, V, S>

impl<K, V, S> FromIterator for LiteMap<K, V, S>

fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self

impl<K, V, S> Index for LiteMap<K, V, S>

fn index(self: &Self, key: &K) -> &V

impl<K, V, S> IndexMut for LiteMap<K, V, S>

fn index_mut(self: &mut Self, key: &K) -> &mut V

impl<K, V, S> IntoIterator for LiteMap<K, V, S>

fn into_iter(self: Self) -> <Self as >::IntoIter

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> UnsafeUnpin for LiteMap<K, V, S>

impl<K, V, S> UnwindSafe for LiteMap<K, V, S>

impl<K: $crate::clone::Clone + ?Sized, V: $crate::clone::Clone + ?Sized, S: $crate::clone::Clone> Clone for LiteMap<K, V, S>

fn clone(self: &Self) -> LiteMap<K, V, S>

impl<K: $crate::cmp::Eq + ?Sized, V: $crate::cmp::Eq + ?Sized, S: $crate::cmp::Eq> Eq for LiteMap<K, V, S>

impl<K: $crate::cmp::Ord + ?Sized, V: $crate::cmp::Ord + ?Sized, S: $crate::cmp::Ord> Ord for LiteMap<K, V, S>

fn cmp(self: &Self, other: &LiteMap<K, V, S>) -> Ordering

impl<K: $crate::cmp::PartialEq + ?Sized, V: $crate::cmp::PartialEq + ?Sized, S: $crate::cmp::PartialEq> PartialEq for LiteMap<K, V, S>

fn eq(self: &Self, other: &LiteMap<K, V, S>) -> bool

impl<K: $crate::cmp::PartialOrd + ?Sized, V: $crate::cmp::PartialOrd + ?Sized, S: $crate::cmp::PartialOrd> PartialOrd for LiteMap<K, V, S>

fn partial_cmp(self: &Self, other: &LiteMap<K, V, S>) -> Option<Ordering>

impl<K: $crate::fmt::Debug + ?Sized, V: $crate::fmt::Debug + ?Sized, S: $crate::fmt::Debug> Debug for LiteMap<K, V, S>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<K: $crate::hash::Hash + ?Sized, V: $crate::hash::Hash + ?Sized, S: $crate::hash::Hash> Hash for LiteMap<K, V, S>

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl<K: ?Sized, V: ?Sized, S> StructuralPartialEq for LiteMap<K, V, S>

impl<T> Any for LiteMap<K, V, S>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for LiteMap<K, V, S>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for LiteMap<K, V, S>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for LiteMap<K, V, S>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for LiteMap<K, V, S>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for LiteMap<K, V, S>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for LiteMap<K, V, S>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for LiteMap<K, V, S>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for LiteMap<K, V, S>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>