SetPos

Trait SetPos 

Source
pub trait SetPos<P: PosT, const WORDS: usize, const SIZE: usize> {
    // Required methods
    fn contains(&self, pos: &P) -> bool;
    fn insert(&mut self, pos: P);
    fn remove(&mut self, pos: &P);

    // Provided method
    fn set(&mut self, pos: P, add: bool) { ... }
}
Expand description

Trait that abstracts sets of super::pos::Pos values

Required Methods§

Source

fn contains(&self, pos: &P) -> bool

Check if the provided super::pos::Pos is in the set

Source

fn insert(&mut self, pos: P)

Insert the provided super::pos::Pos

Source

fn remove(&mut self, pos: &P)

Remove the provided super::pos::Pos

Provided Methods§

Source

fn set(&mut self, pos: P, add: bool)

Insert or remove the provided super::pos::Pos

Implementations on Foreign Types§

Source§

impl<P, const WORDS: usize, const SIZE: usize> SetPos<P, WORDS, SIZE> for BTreeSet<P>
where P: Ord + PosT,

Source§

fn contains(&self, pos: &P) -> bool

Source§

fn insert(&mut self, pos: P)

Source§

fn remove(&mut self, pos: &P)

Source§

impl<P, const WORDS: usize, const SIZE: usize> SetPos<P, WORDS, SIZE> for HashSet<P>
where P: Eq + Hash + PosT,

Source§

fn contains(&self, pos: &P) -> bool

Source§

fn insert(&mut self, pos: P)

Source§

fn remove(&mut self, pos: &P)

Implementors§

Source§

impl<P: PosT, const WORDS: usize, const SIZE: usize> SetPos<P, WORDS, SIZE> for Gridbool<P, WORDS>