[−][src]Struct toolshed::map::BloomMap
A variant of the Map
that includes a bloom filter using the
bloom
function for keys that can be represented as byte slices.
This is ideal for small maps for which querying for absent keys is
a common behavior. In this case it will very likely outperform a
HashMap
, even one with a fast hashing algorithm.
Methods
impl<'arena, K, V> BloomMap<'arena, K, V>
[src]
impl<'arena, K, V: Copy> BloomMap<'arena, K, V>
[src]
ⓘImportant traits for MapIter<'arena, K, V>pub fn iter(&self) -> MapIter<'arena, K, V>
[src]
Get an iterator over key value pairs.
pub fn is_empty(&self) -> bool
[src]
Returns true if the map contains no elements.
pub fn clear(&self)
[src]
Clears the map.
impl<'arena, K, V> BloomMap<'arena, K, V> where
K: Eq + Hash + Copy + AsRef<[u8]>,
V: Copy,
[src]
K: Eq + Hash + Copy + AsRef<[u8]>,
V: Copy,
pub fn insert(&self, arena: &'arena Arena, key: K, value: V) -> Option<V>
[src]
Inserts a key-value pair into the map. If the key was previously set, old value is returned.
pub fn get(&self, key: K) -> Option<V>
[src]
Returns the value corresponding to the key.
pub fn contains_key(&self, key: K) -> bool
[src]
Returns true if the map contains a value for the specified key.
Trait Implementations
impl<'a, 'b, KA, VA, KB, VB> PartialEq<BloomMap<'b, KB, VB>> for BloomMap<'a, KA, VA> where
(&'a KA, VA): PartialEq<(&'b KB, VB)>,
VA: Copy,
VB: Copy,
[src]
(&'a KA, VA): PartialEq<(&'b KB, VB)>,
VA: Copy,
VB: Copy,
fn eq(&self, other: &BloomMap<'b, KB, VB>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'arena, K: Clone, V: Clone> Clone for BloomMap<'arena, K, V>
[src]
fn clone(&self) -> BloomMap<'arena, K, V>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'arena, K: Copy, V: Copy> Copy for BloomMap<'arena, K, V>
[src]
impl<'arena, K, V> From<Map<'arena, K, V>> for BloomMap<'arena, K, V> where
K: Eq + Hash + Copy + AsRef<[u8]>,
V: Copy,
[src]
K: Eq + Hash + Copy + AsRef<[u8]>,
V: Copy,
impl<'arena, K, V> From<BloomMap<'arena, K, V>> for Map<'arena, K, V>
[src]
impl<'arena, K, V: Copy> IntoIterator for BloomMap<'arena, K, V>
[src]
type Item = (&'arena K, V)
The type of the elements being iterated over.
type IntoIter = MapIter<'arena, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'arena, K, V> Debug for BloomMap<'arena, K, V> where
K: Debug,
V: Debug + Copy,
[src]
K: Debug,
V: Debug + Copy,
Auto Trait Implementations
impl<'arena, K, V> Send for BloomMap<'arena, K, V>
impl<'arena, K, V> !Sync for BloomMap<'arena, K, V>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,