Struct CollectionSet

Source
pub struct CollectionSet<'l, Collection: SetCollection>(CollectionRepr<'l, Collection>);
Available on crate feature collection only.
Expand description

SetCollection-based implementation.

On my machine, worst time to check for existence is about 0.6ns/item.

Tuple Fields§

§0: CollectionRepr<'l, Collection>

Implementations§

Source§

impl<Collection: SetCollection> CollectionSet<'_, Collection>

Source

fn c_mut(&mut self) -> &mut Collection

A private method for convenient collection mutation

Trait Implementations§

Source§

impl<Collection: SetCollection> AsRef<Collection> for CollectionSet<'_, Collection>

Source§

fn as_ref(&self) -> &Collection

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<Collection: SetCollection> Borrow<Collection> for CollectionSet<'_, Collection>

Source§

fn borrow(&self) -> &Collection

Immutably borrows from an owned value. Read more
Source§

impl<Collection: SetCollection + Debug> Debug for CollectionSet<'_, Collection>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Collection: SetCollection> Deref for CollectionSet<'_, Collection>

Source§

type Target = Collection

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<Collection: SetCollection> Drop for CollectionSet<'_, Collection>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<Collection: SetCollection> StackedSet for CollectionSet<'_, Collection>

Source§

type Item = <Collection as SetCollection>::Item

Item stored in the set
Source§

type Shorten<'new> = CollectionSet<'new, Collection> where Self: 'new

Intended to be the same type, but living for less time
Source§

type IntoIter<'i> = <Collection as SetCollection>::IntoIter<'i> where Self: 'i

Iterator type for the set
Source§

fn empty() -> Self

Creates an empty set
Source§

fn contains_ref(&self, item: &Self::Item) -> bool

Checks if element is present in the set
Source§

fn extend(&mut self, new_item: Self::Item) -> Self::Shorten<'_>

Adds an item to the stack, returning a new instance now “containing” the item Read more
Source§

fn fork(&mut self) -> Self::Shorten<'_>

Same as StackedSet::extend, but does not actually extend the stackset Read more
Source§

fn iter(&self) -> Self::IntoIter<'_>

Returns iterator over the set, no specific order guaranteed
Source§

fn contains(&self, item: impl Borrow<Self::Item>) -> bool

Checks if element is present in the set

Auto Trait Implementations§

§

impl<'l, Collection> Freeze for CollectionSet<'l, Collection>
where Collection: Freeze, <Collection as SetCollection>::ExtendMemory: Freeze,

§

impl<'l, Collection> RefUnwindSafe for CollectionSet<'l, Collection>
where Collection: RefUnwindSafe, <Collection as SetCollection>::ExtendMemory: RefUnwindSafe,

§

impl<'l, Collection> Send for CollectionSet<'l, Collection>
where Collection: Send, <Collection as SetCollection>::ExtendMemory: Send,

§

impl<'l, Collection> Sync for CollectionSet<'l, Collection>
where Collection: Sync, <Collection as SetCollection>::ExtendMemory: Sync,

§

impl<'l, Collection> Unpin for CollectionSet<'l, Collection>
where Collection: Unpin, <Collection as SetCollection>::ExtendMemory: Unpin,

§

impl<'l, Collection> !UnwindSafe for CollectionSet<'l, Collection>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.