[][src]Struct flurry::HashMapRef

pub struct HashMapRef<'map, K: 'static, V: 'static, S = DefaultHashBuilder> { /* fields omitted */ }

A reference to a HashMap, constructed with HashMap::pin or HashMap::with_guard.

The current thread will be pinned for the duration of this reference. Keep in mind that this prevents the collection of garbage generated by the map.

Methods

impl<'_, K, V, S> HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send,
    S: BuildHasher
[src]

pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

Tests if key is a key in this table. See also HashMap::contains_key.

pub fn get<'g, Q: ?Sized>(&'g self, key: &Q) -> Option<&'g V> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

Returns the value to which key is mapped. See also HashMap::get.

pub fn get_key_value<'g, Q: ?Sized>(&'g self, key: &Q) -> Option<(&'g K, &'g V)> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

Returns the key-value pair corresponding to key. See also HashMap::get_key_value.

pub fn insert(&self, key: K, value: V) -> Option<&V>[src]

Maps key to value in this table. See also HashMap::insert.

pub fn clear(&self)[src]

Removes all entries from this map. See also HashMap::clear.

pub fn compute_if_present<'g, Q: ?Sized, F>(
    &'g self,
    key: &Q,
    remapping_function: F
) -> Option<&'g V> where
    K: Borrow<Q>,
    Q: Hash + Eq,
    F: FnOnce(&K, &V) -> Option<V>, 
[src]

If the value for the specified key is present, attempts to compute a new mapping given the key and its current mapped value. See also HashMap::compute_if_present.

pub fn reserve(&self, additional: usize)[src]

Tries to reserve capacity for at least additional more elements. See also HashMap::reserve.

pub fn remove<'g, Q: ?Sized>(&'g self, key: &Q) -> Option<&'g V> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

Removes the key (and its corresponding value) from this map. See also HashMap::remove.

pub fn retain<F>(&self, f: F) where
    F: FnMut(&K, &V) -> bool
[src]

Retains only the elements specified by the predicate. See also HashMap::retain.

pub fn retain_force<F>(&self, f: F) where
    F: FnMut(&K, &V) -> bool
[src]

Retains only the elements specified by the predicate. See also HashMap::retain_force.

Important traits for Iter<'g, K, V>
pub fn iter(&self) -> Iter<K, V>[src]

An iterator visiting all key-value pairs in arbitrary order. The iterator element type is (&'g K, &'g V). See also HashMap::iter.

Important traits for Keys<'g, K, V>
pub fn keys(&self) -> Keys<K, V>[src]

An iterator visiting all keys in arbitrary order. The iterator element type is &'g K. See also HashMap::keys.

Important traits for Values<'g, K, V>
pub fn values(&self) -> Values<K, V>[src]

An iterator visiting all values in arbitrary order. The iterator element type is &'g V. See also HashMap::values.

pub fn len(&self) -> usize[src]

Returns the number of entries in the map. See also HashMap::len.

pub fn is_empty(&self) -> bool[src]

Returns true if the map is empty. Otherwise returns false. See also HashMap::is_empty.

Trait Implementations

impl<'_, K, V, S> Clone for HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send,
    S: BuildHasher
[src]

impl<'_, K, V, S> Debug for HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq + Debug,
    V: Sync + Send + Debug,
    S: BuildHasher
[src]

impl<'_, K, V, S> Eq for HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send + Eq,
    S: BuildHasher
[src]

impl<'_, '_, K, Q: ?Sized, V, S> Index<&'_ Q> for HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq + Borrow<Q>,
    Q: Hash + Eq,
    V: Sync + Send,
    S: BuildHasher
[src]

type Output = V

The returned type after indexing.

impl<'g, '_, K, V, S> IntoIterator for &'g HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send,
    S: BuildHasher
[src]

type IntoIter = Iter<'g, K, V>

Which kind of iterator are we turning this into?

type Item = (&'g K, &'g V)

The type of the elements being iterated over.

impl<'_, K, V, S> PartialEq<HashMap<K, V, S>> for HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send + PartialEq,
    S: BuildHasher
[src]

impl<'_, K, V, S> PartialEq<HashMapRef<'_, K, V, S>> for HashMapRef<'_, K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send + PartialEq,
    S: BuildHasher
[src]

impl<'_, K, V, S> PartialEq<HashMapRef<'_, K, V, S>> for HashMap<K, V, S> where
    K: Sync + Send + Clone + Hash + Eq,
    V: Sync + Send + PartialEq,
    S: BuildHasher
[src]

Auto Trait Implementations

impl<'map, K, V, S = RandomState> !RefUnwindSafe for HashMapRef<'map, K, V, S>

impl<'map, K, V, S = RandomState> !Send for HashMapRef<'map, K, V, S>

impl<'map, K, V, S = RandomState> !Sync for HashMapRef<'map, K, V, S>

impl<'map, K, V, S> Unpin for HashMapRef<'map, K, V, S>

impl<'map, K, V, S = RandomState> !UnwindSafe for HashMapRef<'map, K, V, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.