Struct StackCons

Source
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 + Debug> Debug for ConsSet<'_, Item>

Source§

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

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

impl<Item: PartialEq> StackedSet for ConsSet<'_, Item>

Source§

type Item = Item

Item stored in the set
Source§

type Shorten<'new> = ConsSet<'new, Item> where Self: 'new

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

type IntoIter<'i> = ConsIter<'i, Item> 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: 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<'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>
where Item: Send + Sync,

§

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> 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<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.