pub struct HashPrefixMap<K, V, S = RandomState>(/* private fields */);Expand description
A prefix map that uses length buckets and hashmaps for lookups
For asciimath, the default hasher makes this the third fastest prefix map. If the qp-trie
feature isn’t enabled, this will be the default. Finding the longest prefix takes
O(len_search_key), but if all keys are long and roughly the same length this may be faster
than QpTriePrefixMap.
§Example
use asciimath_parser::prefix_map::HashPrefixMap;
use asciimath_parser::{ASCIIMATH_TOKENS};
let token_map = HashPrefixMap::from_iter(ASCIIMATH_TOKENS);Implementations§
Source§impl<K, V, S> HashPrefixMap<K, V, S>
impl<K, V, S> HashPrefixMap<K, V, S>
Sourcepub fn from_iter_hasher<T, I>(iter: T) -> Self
pub fn from_iter_hasher<T, I>(iter: T) -> Self
Create from an iterator and custom hasher
Trait Implementations§
Source§impl<K: Clone, V: Clone, S: Clone> Clone for HashPrefixMap<K, V, S>
impl<K: Clone, V: Clone, S: Clone> Clone for HashPrefixMap<K, V, S>
Source§fn clone(&self) -> HashPrefixMap<K, V, S>
fn clone(&self) -> HashPrefixMap<K, V, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V> FromIterator<(K, V)> for HashPrefixMap<K, V>
impl<K, V> FromIterator<(K, V)> for HashPrefixMap<K, V>
Auto Trait Implementations§
impl<K, V, S> Freeze for HashPrefixMap<K, V, S>
impl<K, V, S> RefUnwindSafe for HashPrefixMap<K, V, S>
impl<K, V, S> Send for HashPrefixMap<K, V, S>
impl<K, V, S> Sync for HashPrefixMap<K, V, S>
impl<K, V, S> Unpin for HashPrefixMap<K, V, S>
impl<K, V, S> UnsafeUnpin for HashPrefixMap<K, V, S>
impl<K, V, S> UnwindSafe for HashPrefixMap<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
Mutably borrows from an owned value. Read more