Struct enso_flexer::prelude::weak_table::WeakKeyHashMap [−][src]
pub struct WeakKeyHashMap<K, V, S = RandomState> { /* fields omitted */ }
Expand description
A hash map with weak keys, hashed on key value.
When a weak pointer expires, its mapping is lazily removed.
Implementations
impl<K, V> WeakKeyHashMap<K, V, RandomState> where
K: WeakKey,
[src]
impl<K, V> WeakKeyHashMap<K, V, RandomState> where
K: WeakKey,
[src]pub fn new() -> WeakKeyHashMap<K, V, RandomState>
[src]
pub fn new() -> WeakKeyHashMap<K, V, RandomState>
[src]Creates an empty WeakKeyHashMap
.
pub fn with_capacity(capacity: usize) -> WeakKeyHashMap<K, V, RandomState>
[src]
pub fn with_capacity(capacity: usize) -> WeakKeyHashMap<K, V, RandomState>
[src]Creates an empty WeakKeyHashMap
with the given capacity.
impl<K, V, S> WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
[src]
impl<K, V, S> WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
[src]pub fn with_hasher(hash_builder: S) -> WeakKeyHashMap<K, V, S>
[src]
pub fn with_hasher(hash_builder: S) -> WeakKeyHashMap<K, V, S>
[src]Creates an empty WeakKeyHashMap
with the given capacity and hasher.
pub fn with_capacity_and_hasher(
capacity: usize,
hash_builder: S
) -> WeakKeyHashMap<K, V, S>
[src]
pub fn with_capacity_and_hasher(
capacity: usize,
hash_builder: S
) -> WeakKeyHashMap<K, V, S>
[src]Creates an empty WeakKeyHashMap
with the given capacity and hasher.
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]Returns the number of elements the map can hold without reallocating.
pub fn remove_expired(&mut self)
[src]
pub fn remove_expired(&mut self)
[src]Removes all mappings whose keys have expired.
pub fn shrink_to_fit(&mut self)
[src]
pub fn shrink_to_fit(&mut self)
[src]Shrinks the capacity to the minimum allowed to hold the current number of elements.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
[src]Is the map empty?
Note that this may return false even if all keys in the map have expired, if they haven’t been collected yet.
pub fn load_factor(&self) -> f32
[src]
pub fn load_factor(&self) -> f32
[src]The proportion of buckets that are used.
This is an over-approximation because of expired keys.
pub fn entry(&mut self, key: <K as WeakElement>::Strong) -> Entry<'_, K, V>
[src]
pub fn entry(&mut self, key: <K as WeakElement>::Strong) -> Entry<'_, K, V>
[src]Gets the requested entry.
pub fn get<Q>(&self, key: &Q) -> Option<&V> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn get<Q>(&self, key: &Q) -> Option<&V> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Returns a reference to the value corresponding to the key.
pub fn contains_key<Q>(&self, key: &Q) -> bool where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn contains_key<Q>(&self, key: &Q) -> bool where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Returns true if the map contains the specified key.
pub fn get_key<Q>(&self, key: &Q) -> Option<<K as WeakElement>::Strong> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn get_key<Q>(&self, key: &Q) -> Option<<K as WeakElement>::Strong> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Returns a strong reference to the key, if found.
pub fn get_both<Q>(&self, key: &Q) -> Option<(<K as WeakElement>::Strong, &V)> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn get_both<Q>(&self, key: &Q) -> Option<(<K as WeakElement>::Strong, &V)> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Returns a pair of a strong reference to the key, and a reference to the value, if present.
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Returns a mutable reference to the value corresponding to the key.
pub fn get_both_mut<Q>(
&mut self,
key: &Q
) -> Option<(<K as WeakElement>::Strong, &mut V)> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn get_both_mut<Q>(
&mut self,
key: &Q
) -> Option<(<K as WeakElement>::Strong, &mut V)> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Returns a pair of a strong reference to the key, and a mutable reference to the value, if present.
pub fn insert(&mut self, key: <K as WeakElement>::Strong, value: V) -> Option<V>
[src]
pub fn insert(&mut self, key: <K as WeakElement>::Strong, value: V) -> Option<V>
[src]Unconditionally inserts the value, returning the old value if already present.
Unlike std::collections::HashMap
, this replaced the key even if occupied.
pub fn remove<Q>(&mut self, key: &Q) -> Option<V> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
pub fn remove<Q>(&mut self, key: &Q) -> Option<V> where
Q: Hash + Eq + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]Removes the entry with the given key, if it exists, and returns the value.
pub fn retain<F>(&mut self, f: F) where
F: FnMut(<K as WeakElement>::Strong, &mut V) -> bool,
[src]
pub fn retain<F>(&mut self, f: F) where
F: FnMut(<K as WeakElement>::Strong, &mut V) -> bool,
[src]Removes all mappings not satisfying the given predicate.
Also removes any expired mappings.
pub fn is_submap_with<F, S1, V1>(
&self,
other: &WeakKeyHashMap<K, V1, S1>,
value_equal: F
) -> bool where
F: FnMut(&V, &V1) -> bool,
S1: BuildHasher,
[src]
pub fn is_submap_with<F, S1, V1>(
&self,
other: &WeakKeyHashMap<K, V1, S1>,
value_equal: F
) -> bool where
F: FnMut(&V, &V1) -> bool,
S1: BuildHasher,
[src]Is this map a submap of the other, using the given value comparison.
In particular, all the keys of self
must be in other
and the values must compare
true
with value_equal
.
pub fn is_submap<V1, S1>(&self, other: &WeakKeyHashMap<K, V1, S1>) -> bool where
V: PartialEq<V1>,
S1: BuildHasher,
[src]
pub fn is_submap<V1, S1>(&self, other: &WeakKeyHashMap<K, V1, S1>) -> bool where
V: PartialEq<V1>,
S1: BuildHasher,
[src]Is self
a submap of other
?
pub fn domain_is_subset<V1, S1>(
&self,
other: &WeakKeyHashMap<K, V1, S1>
) -> bool where
S1: BuildHasher,
[src]
pub fn domain_is_subset<V1, S1>(
&self,
other: &WeakKeyHashMap<K, V1, S1>
) -> bool where
S1: BuildHasher,
[src]Are the keys of self
a subset of the keys of other
?
impl<K, V, S> WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]
impl<K, V, S> WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]pub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>
impl<'a, K, V> Iterator for Iter<'a, K, V> where
K: WeakElement, type Item = (<K as WeakElement>::Strong, &'a V);
[src]
pub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>
impl<'a, K, V> Iterator for Iter<'a, K, V> where
K: WeakElement, type Item = (<K as WeakElement>::Strong, &'a V);
[src]Gets an iterator over the keys and values.
pub fn keys(&self) -> Keys<'_, K, V>ⓘNotable traits for Keys<'a, K, V>
impl<'a, K, V> Iterator for Keys<'a, K, V> where
K: WeakElement, type Item = <K as WeakElement>::Strong;
[src]
pub fn keys(&self) -> Keys<'_, K, V>ⓘNotable traits for Keys<'a, K, V>
impl<'a, K, V> Iterator for Keys<'a, K, V> where
K: WeakElement, type Item = <K as WeakElement>::Strong;
[src]Gets an iterator over the keys.
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘNotable traits for IterMut<'a, K, V>
impl<'a, K, V> Iterator for IterMut<'a, K, V> where
K: WeakElement, type Item = (<K as WeakElement>::Strong, &'a mut V);
[src]
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘNotable traits for IterMut<'a, K, V>
impl<'a, K, V> Iterator for IterMut<'a, K, V> where
K: WeakElement, type Item = (<K as WeakElement>::Strong, &'a mut V);
[src]Gets an iterator over the keys and mutable values.
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>ⓘ
[src]
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>ⓘ
[src]Gets an iterator over the mutable values.
Trait Implementations
impl<K, V, S> Clone for WeakKeyHashMap<K, V, S> where
S: Clone,
K: Clone,
V: Clone,
[src]
impl<K, V, S> Clone for WeakKeyHashMap<K, V, S> where
S: Clone,
K: Clone,
V: Clone,
[src]pub fn clone(&self) -> WeakKeyHashMap<K, V, S>
[src]
pub fn clone(&self) -> WeakKeyHashMap<K, V, S>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<K, V, S> Debug for WeakKeyHashMap<K, V, S> where
K: WeakElement,
V: Debug,
<K as WeakElement>::Strong: Debug,
[src]
impl<K, V, S> Debug for WeakKeyHashMap<K, V, S> where
K: WeakElement,
V: Debug,
<K as WeakElement>::Strong: Debug,
[src]impl<K, V, S> Default for WeakKeyHashMap<K, V, S> where
S: BuildHasher + Default,
K: WeakKey,
[src]
impl<K, V, S> Default for WeakKeyHashMap<K, V, S> where
S: BuildHasher + Default,
K: WeakKey,
[src]pub fn default() -> WeakKeyHashMap<K, V, S>
[src]
pub fn default() -> WeakKeyHashMap<K, V, S>
[src]Returns the “default value” for a type. Read more
impl<'a, K, V, S> Extend<(&'a <K as WeakElement>::Strong, &'a V)> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: 'a + WeakKey,
V: 'a + Clone,
<K as WeakElement>::Strong: Clone,
[src]
impl<'a, K, V, S> Extend<(&'a <K as WeakElement>::Strong, &'a V)> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: 'a + WeakKey,
V: 'a + Clone,
<K as WeakElement>::Strong: Clone,
[src]pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = (&'a <K as WeakElement>::Strong, &'a V)>,
[src]
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = (&'a <K as WeakElement>::Strong, &'a V)>,
[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)
[src]
fn extend_one(&mut self, item: A)
[src]extend_one
)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl<K, V, S> Extend<(<K as WeakElement>::Strong, V)> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
[src]
impl<K, V, S> Extend<(<K as WeakElement>::Strong, V)> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
[src]pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = (<K as WeakElement>::Strong, V)>,
[src]
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = (<K as WeakElement>::Strong, V)>,
[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)
[src]
fn extend_one(&mut self, item: A)
[src]extend_one
)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl<K, V, S> FromIterator<(<K as WeakElement>::Strong, V)> for WeakKeyHashMap<K, V, S> where
S: BuildHasher + Default,
K: WeakKey,
[src]
impl<K, V, S> FromIterator<(<K as WeakElement>::Strong, V)> for WeakKeyHashMap<K, V, S> where
S: BuildHasher + Default,
K: WeakKey,
[src]pub fn from_iter<T>(iter: T) -> WeakKeyHashMap<K, V, S> where
T: IntoIterator<Item = (<K as WeakElement>::Strong, V)>,
[src]
pub fn from_iter<T>(iter: T) -> WeakKeyHashMap<K, V, S> where
T: IntoIterator<Item = (<K as WeakElement>::Strong, V)>,
[src]Creates a value from an iterator. Read more
impl<'a, K, V, S, Q> Index<&'a Q> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
Q: Eq + Hash + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
impl<'a, K, V, S, Q> Index<&'a Q> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
Q: Eq + Hash + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]impl<'a, K, V, S, Q> IndexMut<&'a Q> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
Q: Eq + Hash + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]
impl<'a, K, V, S, Q> IndexMut<&'a Q> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
Q: Eq + Hash + ?Sized,
<K as WeakKey>::Key: Borrow<Q>,
[src]impl<'a, K, V, S> IntoIterator for &'a mut WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]
impl<'a, K, V, S> IntoIterator for &'a mut WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]pub fn into_iter(
self
) -> <&'a mut WeakKeyHashMap<K, V, S> as IntoIterator>::IntoIter
[src]
pub fn into_iter(
self
) -> <&'a mut WeakKeyHashMap<K, V, S> as IntoIterator>::IntoIter
[src]Creates an iterator from a value. Read more
impl<K, V, S> IntoIterator for WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]
impl<K, V, S> IntoIterator for WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]type Item = (<K as WeakElement>::Strong, V)
type Item = (<K as WeakElement>::Strong, V)
The type of the elements being iterated over.
pub fn into_iter(self) -> <WeakKeyHashMap<K, V, S> as IntoIterator>::IntoIter
[src]
pub fn into_iter(self) -> <WeakKeyHashMap<K, V, S> as IntoIterator>::IntoIter
[src]Creates an iterator from a value. Read more
impl<'a, K, V, S> IntoIterator for &'a WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]
impl<'a, K, V, S> IntoIterator for &'a WeakKeyHashMap<K, V, S> where
K: WeakElement,
[src]pub fn into_iter(
self
) -> <&'a WeakKeyHashMap<K, V, S> as IntoIterator>::IntoIter
[src]
pub fn into_iter(
self
) -> <&'a WeakKeyHashMap<K, V, S> as IntoIterator>::IntoIter
[src]Creates an iterator from a value. Read more
impl<K, V, V1, S, S1> PartialEq<WeakKeyHashMap<K, V1, S1>> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
V: PartialEq<V1>,
S1: BuildHasher,
[src]
impl<K, V, V1, S, S1> PartialEq<WeakKeyHashMap<K, V1, S1>> for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
V: PartialEq<V1>,
S1: BuildHasher,
[src]impl<K, V, S> Eq for WeakKeyHashMap<K, V, S> where
S: BuildHasher,
K: WeakKey,
V: Eq,
[src]
S: BuildHasher,
K: WeakKey,
V: Eq,
Auto Trait Implementations
impl<K, V, S> RefUnwindSafe for WeakKeyHashMap<K, V, S> where
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, S> Send for WeakKeyHashMap<K, V, S> where
K: Send,
S: Send,
V: Send,
K: Send,
S: Send,
V: Send,
impl<K, V, S> Sync for WeakKeyHashMap<K, V, S> where
K: Sync,
S: Sync,
V: Sync,
K: Sync,
S: Sync,
V: Sync,
impl<K, V, S> Unpin for WeakKeyHashMap<K, V, S> where
S: Unpin,
S: Unpin,
impl<K, V, S> UnwindSafe for WeakKeyHashMap<K, V, S> where
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> HasRefValue for T where
T: ?Sized,
[src]
impl<T> HasRefValue for T where
T: ?Sized,
[src]type RefValue = T
impl<T> PhantomConversions for T
[src]
impl<T> PhantomConversions for T
[src]fn phantom_into<P>() -> P where
Self: PhantomInto<P>,
[src]
Self: PhantomInto<P>,
fn phantom_from<P>() -> Self where
P: PhantomInto<Self>,
[src]
P: PhantomInto<Self>,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> TypeDisplay for T
[src]
impl<T> TypeDisplay for T
[src]pub default fn type_display() -> String
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> Writer for T
[src]
impl<T> Writer for T
[src]pub default fn write_by_level(&self, message: &Array)
[src]
pub default fn write_by_level(&self, message: &Array)
[src]Write message using the appropriate console method.