Struct enso_flexer::prelude::logger::prelude::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

impl<T> PtrWeakHashSet<T, RandomState> where
    T: WeakElement,
    <T as WeakElement>::Strong: Deref
[src]

pub fn new() -> PtrWeakHashSet<T, RandomState>[src]

Creates an empty PtrWeakHashSet.

pub fn with_capacity(capacity: usize) -> PtrWeakHashSet<T, RandomState>[src]

Creates an empty PtrWeakHashSet with the given capacity.

impl<T, S> PtrWeakHashSet<T, S> where
    T: WeakElement,
    S: BuildHasher,
    <T as WeakElement>::Strong: Deref
[src]

pub fn with_hasher(hash_builder: S) -> PtrWeakHashSet<T, S>[src]

Creates an empty PtrWeakHashSet with the given capacity and hasher.

pub fn with_capacity_and_hasher(
    capacity: usize,
    hash_builder: S
) -> PtrWeakHashSet<T, S>
[src]

Creates an empty PtrWeakHashSet with the given capacity and hasher.

pub fn hasher(&self) -> &S[src]

Returns a reference to the map’s BuildHasher.

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

Returns the number of elements the map can hold without reallocating.

pub fn remove_expired(&mut self)[src]

Removes all mappings whose keys have expired.

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

Reserves room for additional elements.

pub fn shrink_to_fit(&mut self)[src]

Shrinks the capacity to the minimum allowed to hold the current number of elements.

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

Returns an over-approximation of the number of elements.

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

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.

pub fn load_factor(&self) -> f32[src]

The proportion of buckets that are used.

This is an over-approximation because of expired elements.

pub fn clear(&mut self)[src]

Removes all associations from the map.

pub fn contains(&self, key: &<T as WeakElement>::Strong) -> bool[src]

Returns true if the map contains the specified key.

pub fn insert(&mut self, key: <T as WeakElement>::Strong) -> bool[src]

Unconditionally inserts the value, returning the old value if already present. Does not replace the key.

pub fn remove(&mut self, key: &<T as WeakElement>::Strong) -> bool[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(<T as WeakElement>::Strong) -> bool
[src]

Removes all mappings not satisfying the given predicate.

Also removes any expired mappings.

pub fn is_subset<S1>(&self, other: &PtrWeakHashSet<T, S1>) -> bool where
    S1: BuildHasher
[src]

Is self a subset of other?

impl<T, S> PtrWeakHashSet<T, S> where
    T: WeakElement,
    <T as WeakElement>::Strong: Deref
[src]

pub fn iter(&self) -> Iter<'_, T>

Notable traits for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T> where
    T: WeakElement
type Item = <T as WeakElement>::Strong;
[src]

Gets an iterator over the keys and values.

pub fn drain(&mut self) -> Drain<'_, T>

Notable traits for Drain<'a, T>

impl<'a, T> Iterator for Drain<'a, T> where
    T: WeakElement
type Item = <T as WeakElement>::Strong;
[src]

Gets a draining iterator, which removes all the values but retains the storage.

Trait Implementations

impl<T, S> Clone for PtrWeakHashSet<T, S> where
    T: Clone,
    S: Clone
[src]

pub fn clone(&self) -> PtrWeakHashSet<T, S>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T, S> Debug for PtrWeakHashSet<T, S> where
    T: WeakElement,
    <T as WeakElement>::Strong: Debug
[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl<T, S> Default for PtrWeakHashSet<T, S> where
    T: WeakElement,
    S: BuildHasher + Default,
    <T as WeakElement>::Strong: Deref
[src]

pub fn default() -> PtrWeakHashSet<T, S>[src]

Returns the “default value” for a type. Read more

impl<T, S> Extend<<T as WeakElement>::Strong> for PtrWeakHashSet<T, S> where
    T: WeakElement,
    S: BuildHasher,
    <T as WeakElement>::Strong: Deref
[src]

pub fn extend<I>(&mut self, iter: I) where
    I: IntoIterator<Item = <T as WeakElement>::Strong>, 
[src]

Extends a collection with the contents of an iterator. Read more

fn extend_one(&mut self, item: A)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

fn extend_reserve(&mut self, additional: usize)[src]

🔬 This is a nightly-only experimental API. (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,
    S: BuildHasher + Default,
    <T as WeakElement>::Strong: Deref
[src]

pub fn from_iter<I>(iter: I) -> PtrWeakHashSet<T, S> where
    I: IntoIterator<Item = <T as WeakElement>::Strong>, 
[src]

Creates a value from an iterator. Read more

impl<'a, T, S> IntoIterator for &'a PtrWeakHashSet<T, S> where
    T: WeakElement,
    <T as WeakElement>::Strong: Deref
[src]

type Item = <T as WeakElement>::Strong

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

pub fn into_iter(self) -> <&'a PtrWeakHashSet<T, S> as IntoIterator>::IntoIter[src]

Creates an iterator from a value. Read more

impl<T, S> IntoIterator for PtrWeakHashSet<T, S> where
    T: WeakElement
[src]

type Item = <T as WeakElement>::Strong

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

pub fn into_iter(self) -> <PtrWeakHashSet<T, S> as IntoIterator>::IntoIter[src]

Creates an iterator from a value. Read more

impl<T, S, S1> PartialEq<PtrWeakHashSet<T, S1>> for PtrWeakHashSet<T, S> where
    T: WeakElement,
    S: BuildHasher,
    S1: BuildHasher,
    <T as WeakElement>::Strong: Deref
[src]

pub fn eq(&self, other: &PtrWeakHashSet<T, S1>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<T, S> Eq for PtrWeakHashSet<T, S> where
    T: WeakElement,
    S: BuildHasher,
    <T as WeakElement>::Strong: Deref
[src]

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

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

type RefValue = T

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> PhantomConversions for T[src]

fn phantom_into<P>() -> P where
    Self: PhantomInto<P>, 
[src]

fn phantom_from<P>() -> Self where
    P: PhantomInto<Self>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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

Checks if self is actually part of its subset T (and can be converted to it).

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

The inclusion map: converts self to the equivalent element of its superset.

impl<T> ToImpl for T[src]

fn to<P>(self) -> P where
    Self: Into<P>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 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> ToRef<T> for T where
    T: ?Sized
[src]

pub fn to_ref(&self) -> &T[src]

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> TypeDisplay for T[src]

pub default fn type_display() -> String[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> Writer for T[src]

pub default fn write_by_level(&self, message: &Array)[src]

Write message using the appropriate console method.