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>
impl<Collection: SetCollection> CollectionSet<'_, Collection>
Sourcefn c_mut(&mut self) -> &mut Collection
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>
impl<Collection: SetCollection> AsRef<Collection> for CollectionSet<'_, Collection>
Source§fn as_ref(&self) -> &Collection
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>
impl<Collection: SetCollection> Borrow<Collection> for CollectionSet<'_, Collection>
Source§fn borrow(&self) -> &Collection
fn borrow(&self) -> &Collection
Immutably borrows from an owned value. Read more
Source§impl<Collection: SetCollection + Debug> Debug for CollectionSet<'_, Collection>
impl<Collection: SetCollection + Debug> Debug for CollectionSet<'_, Collection>
Source§impl<Collection: SetCollection> Deref for CollectionSet<'_, Collection>
impl<Collection: SetCollection> Deref for CollectionSet<'_, Collection>
Source§impl<Collection: SetCollection> Drop for CollectionSet<'_, Collection>
impl<Collection: SetCollection> Drop for CollectionSet<'_, Collection>
Source§impl<Collection: SetCollection> StackedSet for CollectionSet<'_, Collection>
impl<Collection: SetCollection> StackedSet for CollectionSet<'_, Collection>
Source§type Item = <Collection as SetCollection>::Item
type Item = <Collection as SetCollection>::Item
Item stored in the set
Source§type Shorten<'new> = CollectionSet<'new, Collection>
where
Self: 'new
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
type IntoIter<'i> = <Collection as SetCollection>::IntoIter<'i> where Self: 'i
Iterator type for the set
Source§fn contains_ref(&self, item: &Self::Item) -> bool
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<'_>
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<'_>
fn fork(&mut self) -> Self::Shorten<'_>
Same as
StackedSet::extend
, but does not actually extend the stackset Read moreAuto Trait Implementations§
impl<'l, Collection> Freeze for CollectionSet<'l, Collection>
impl<'l, Collection> RefUnwindSafe for CollectionSet<'l, Collection>
impl<'l, Collection> Send for CollectionSet<'l, Collection>
impl<'l, Collection> Sync for CollectionSet<'l, Collection>
impl<'l, Collection> Unpin for CollectionSet<'l, Collection>
impl<'l, Collection> !UnwindSafe for CollectionSet<'l, Collection>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more