KeySet

Trait KeySet 

Source
pub trait KeySet: Default {
    type Iter<'a>: Iterator<Item = Key>
       where Self: 'a;

    // Required methods
    fn insert(&mut self, key: Key);
    fn remove(&mut self, key: &Key);
    fn contains(&self, key: &Key) -> bool;
    fn iter(&self) -> Self::Iter<'_>;
    fn is_empty(&self) -> bool;
    fn count(&self) -> usize;
}

Required Associated Types§

Source

type Iter<'a>: Iterator<Item = Key> where Self: 'a

Required Methods§

Source

fn insert(&mut self, key: Key)

Source

fn remove(&mut self, key: &Key)

Source

fn contains(&self, key: &Key) -> bool

Source

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

Source

fn is_empty(&self) -> bool

Source

fn count(&self) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl KeySet for BTreeSet<Key>

Source§

type Iter<'a> = Copied<Iter<'a, Key>> where Self: 'a

Source§

fn insert(&mut self, key: Key)

Source§

fn remove(&mut self, key: &Key)

Source§

fn contains(&self, key: &Key) -> bool

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

fn count(&self) -> usize

Source§

impl KeySet for RoaringTreemap

Available on crate feature roaring only.
Source§

type Iter<'a> = RoaringIter<'a> where Self: 'a

Source§

fn insert(&mut self, key: Key)

Source§

fn remove(&mut self, key: &Key)

Source§

fn contains(&self, key: &Key) -> bool

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

fn count(&self) -> usize

Source§

impl KeySet for HashSet<Key>

Available on crate feature imbl only.
Source§

type Iter<'a> = Copied<Iter<'a, Key, ArcK>> where Self: 'a

Source§

fn insert(&mut self, key: Key)

Source§

fn remove(&mut self, key: &Key)

Source§

fn contains(&self, key: &Key) -> bool

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

fn count(&self) -> usize

Source§

impl KeySet for OrdSet<Key>

Available on crate feature imbl only.
Source§

type Iter<'a> = Copied<Iter<'a, Key, ArcK>> where Self: 'a

Source§

fn insert(&mut self, key: Key)

Source§

fn remove(&mut self, key: &Key)

Source§

fn contains(&self, key: &Key) -> bool

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

fn count(&self) -> usize

Source§

impl<S: BuildHasher + Default> KeySet for HashSet<Key, S>

Available on crate feature std only.
Source§

type Iter<'a> = Copied<Iter<'a, Key>> where Self: 'a

Source§

fn insert(&mut self, key: Key)

Source§

fn remove(&mut self, key: &Key)

Source§

fn contains(&self, key: &Key) -> bool

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

fn count(&self) -> usize

Source§

impl<S: BuildHasher + Default> KeySet for HashSet<Key, S>

Source§

type Iter<'a> = Copied<Iter<'a, Key>> where Self: 'a

Source§

fn insert(&mut self, key: Key)

Source§

fn remove(&mut self, key: &Key)

Source§

fn contains(&self, key: &Key) -> bool

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

fn count(&self) -> usize

Implementors§