EytzingerRefMap

Type Alias EytzingerRefMap 

Source
pub type EytzingerRefMap<'a, K, V> = EytzingerMap<&'a [(K, V)]>;
Expand description

A map based on a slice ref with Eytzinger binary search. See EytzingerMap for details.

This is useful when the base data is owned by other data.

use eytzinger_map::EytzingerRefMap;

let mut vec = vec![(1, "a"), (2, "b"), (3, "c")];
let map = EytzingerRefMap::from_ref(vec.as_mut_slice());
assert_eq!(map[&1], "a");

Aliased Type§

pub struct EytzingerRefMap<'a, K, V>(/* private fields */);

Implementations§

Source§

impl<'a, K, V> EytzingerRefMap<'a, K, V>
where K: Ord,

Source

pub fn from_sorted_ref(s: &'a mut [(K, V)]) -> Self

Source

pub fn from_ref(s: &'a mut [(K, V)]) -> Self