pub struct StackCons<'tail, Item>(ConsRepr<'tail, Item>);
Available on crate feature
cons
only.Expand description
Cons list
-like implementation of StackedSet
On my machine, worst time to check for existence is about 2ns/item
Tuple Fields§
§0: ConsRepr<'tail, Item>
Trait Implementations§
Source§impl<Item: PartialEq> StackedSet for ConsSet<'_, Item>
impl<Item: PartialEq> StackedSet for ConsSet<'_, Item>
Source§type Shorten<'new> = ConsSet<'new, Item>
where
Self: 'new
type Shorten<'new> = ConsSet<'new, Item> where Self: 'new
Intended to be the same type, but living for less time
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: Item) -> Self::Shorten<'_>
fn extend(&mut self, new_item: 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<'tail, Item> Freeze for ConsSet<'tail, Item>where
Item: Freeze,
impl<'tail, Item> RefUnwindSafe for ConsSet<'tail, Item>where
Item: RefUnwindSafe,
impl<'tail, Item> Send for ConsSet<'tail, Item>
impl<'tail, Item> Sync for ConsSet<'tail, Item>where
Item: Sync,
impl<'tail, Item> Unpin for ConsSet<'tail, Item>where
Item: Unpin,
impl<'tail, Item> UnwindSafe for ConsSet<'tail, Item>where
Item: UnwindSafe + RefUnwindSafe,
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