Struct weak_table::PtrWeakHashSet [−][src]
pub struct PtrWeakHashSet<T, S = RandomState>(_);
Expand description
A hash set with weak elements, hashed on element pointer.
When a weak pointer expires, its mapping is lazily removed.
Implementations
Creates an empty PtrWeakHashSet
with the given capacity.
O(n) time
Creates an empty PtrWeakHashSet
with the given capacity and hasher.
O(n) time
Creates an empty PtrWeakHashSet
with the given capacity and hasher.
O(n) time
Returns the number of elements the map can hold without reallocating.
O(1) time
Removes all mappings whose keys have expired.
O(n) time
Reserves room for additional elements.
O(n) time
Shrinks the capacity to the minimum allowed to hold the current number of elements.
O(n) time
Is the set known to be empty?
This could answer false
for an empty set whose elements have
expired but have yet to be collected.
O(1) time
The proportion of buckets that are used.
This is an over-approximation because of expired elements.
O(1) time
Returns true if the map contains the specified key.
expected O(1) time; worst-case O(p) time
Unconditionally inserts the value, returning the old value if already present. Does not replace the key.
expected O(1) time; worst-case O(p) time
Removes the entry with the given key, if it exists, and returns the value.
expected O(1) time; worst-case O(p) time
Removes all mappings not satisfying the given predicate.
Also removes any expired mappings.
O(n) time
Is self a subset of other?
expected O(n) time; worst-case O(nq) time (where n is
self.capacity()
and q is the length of the probe sequences
in other
)
Gets an iterator over the keys and values.
O(1) time
Trait Implementations
impl<T: WeakElement, S: BuildHasher + Default> Default for PtrWeakHashSet<T, S> where
T::Strong: Deref,
impl<T: WeakElement, S: BuildHasher + Default> Default for PtrWeakHashSet<T, S> where
T::Strong: Deref,
impl<T, S> Extend<<T as WeakElement>::Strong> for PtrWeakHashSet<T, S> where
T: WeakElement,
T::Strong: Deref,
S: BuildHasher,
impl<T, S> Extend<<T as WeakElement>::Strong> for PtrWeakHashSet<T, S> where
T: WeakElement,
T::Strong: Deref,
S: BuildHasher,
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl<T, S> FromIterator<<T as WeakElement>::Strong> for PtrWeakHashSet<T, S> where
T: WeakElement,
T::Strong: Deref,
S: BuildHasher + Default,
impl<T, S> FromIterator<<T as WeakElement>::Strong> for PtrWeakHashSet<T, S> where
T: WeakElement,
T::Strong: Deref,
S: BuildHasher + Default,
Creates a value from an iterator. Read more
impl<T, S, S1> PartialEq<PtrWeakHashSet<T, S1>> for PtrWeakHashSet<T, S> where
T: WeakElement,
T::Strong: Deref,
S: BuildHasher,
S1: BuildHasher,
impl<T, S, S1> PartialEq<PtrWeakHashSet<T, S1>> for PtrWeakHashSet<T, S> where
T: WeakElement,
T::Strong: Deref,
S: BuildHasher,
S1: BuildHasher,
Auto Trait Implementations
impl<T, S> RefUnwindSafe for PtrWeakHashSet<T, S> where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for PtrWeakHashSet<T, S> where
S: Send,
T: Send,
impl<T, S> Sync for PtrWeakHashSet<T, S> where
S: Sync,
T: Sync,
impl<T, S> Unpin for PtrWeakHashSet<T, S> where
S: Unpin,
impl<T, S> UnwindSafe for PtrWeakHashSet<T, S> where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more