Skip to main content

VariadicCollection

Trait VariadicCollection 

Source
pub trait VariadicCollection: Extend<Self::Schema> {
    type Schema: PartialEqVariadic;

    // Required methods
    fn insert(&mut self, element: Self::Schema) -> bool;
    fn iter(
        &self,
    ) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>;
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn drain(&mut self) -> impl Iterator<Item = Self::Schema>;
    fn contains(
        &self,
        value: <Self::Schema as VariadicExt>::AsRefVar<'_>,
    ) -> bool;
}
Expand description

Trait for a set of Variadic Tuples

Required Associated Types§

Source

type Schema: PartialEqVariadic

The Schema (aka Variadic type) associated with tuples in this set

Required Methods§

Source

fn insert(&mut self, element: Self::Schema) -> bool

Insert an element into the set, return true if successful

Source

fn iter( &self, ) -> impl Iterator<Item = <Self::Schema as VariadicExt>::AsRefVar<'_>>

Iterate over the elements of the set

Source

fn len(&self) -> usize

Return number of elements in the set

Source

fn is_empty(&self) -> bool

Return true if empty

Source

fn drain(&mut self) -> impl Iterator<Item = Self::Schema>

iterate and drain items from the set without deallocating the container

Source

fn contains(&self, value: <Self::Schema as VariadicExt>::AsRefVar<'_>) -> bool

Check for containment

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, S> VariadicCollection for VariadicCountedHashSet<K, S>
where K: VariadicExt + PartialEqVariadic + Eq + Hash + Clone, for<'a> K::AsRefVar<'a>: Hash, S: BuildHasher,

Source§

impl<Schema> VariadicCollection for VariadicColumnMultiset<Schema>
where Schema: PartialEqVariadic + Eq + Hash, for<'a> <Schema as VariadicExt>::AsRefVar<'a>: Hash,

Available on crate feature alloc only.
Source§

type Schema = Schema

Source§

impl<T, S> VariadicCollection for VariadicHashSet<T, S>
where T: VariadicExt + PartialEqVariadic + Eq + Hash, for<'a> T::AsRefVar<'a>: Hash, S: BuildHasher,