SetBacking

Trait SetBacking 

Source
pub trait SetBacking: Sealed {
    // Required methods
    fn capacity(&self) -> usize;
    fn contains(&self, index: usize) -> bool;
    fn insert(&mut self, index: usize);
    fn remove(&mut self, index: usize);
    fn clear_all(&mut self);
}
Expand description

Behavior required from membership backings.

This trait is sealed; it can only be implemented by types provided by this crate (currently [bool] and [u64]). Users opt into different behaviors by passing these different slice types to TinySetQueue::new.

Required Methods§

Source

fn capacity(&self) -> usize

Number of representable entries in the membership domain.

Source

fn contains(&self, index: usize) -> bool

Returns true when the given index is present.

Source

fn insert(&mut self, index: usize)

Inserts the given index.

Source

fn remove(&mut self, index: usize)

Removes the given index.

Source

fn clear_all(&mut self)

Clears all membership information.

Implementations on Foreign Types§

Source§

impl SetBacking for [bool]

Source§

fn capacity(&self) -> usize

Source§

fn contains(&self, index: usize) -> bool

Source§

fn insert(&mut self, index: usize)

Source§

fn remove(&mut self, index: usize)

Source§

fn clear_all(&mut self)

Source§

impl SetBacking for [u64]

Source§

fn capacity(&self) -> usize

Source§

fn contains(&self, index: usize) -> bool

Source§

fn insert(&mut self, index: usize)

Source§

fn remove(&mut self, index: usize)

Source§

fn clear_all(&mut self)

Source§

impl<const N: usize> SetBacking for [bool; N]

Source§

fn capacity(&self) -> usize

Source§

fn contains(&self, index: usize) -> bool

Source§

fn insert(&mut self, index: usize)

Source§

fn remove(&mut self, index: usize)

Source§

fn clear_all(&mut self)

Source§

impl<const N: usize> SetBacking for [u64; N]

Source§

fn capacity(&self) -> usize

Source§

fn contains(&self, index: usize) -> bool

Source§

fn insert(&mut self, index: usize)

Source§

fn remove(&mut self, index: usize)

Source§

fn clear_all(&mut self)

Implementors§