Trait sqrid::setpos::SetPos

source ·
pub trait SetPos<const W: u16, const H: u16, const WORDS: usize, const SIZE: usize> {
    // Required methods
    fn contains(&self, pos: &Pos<W, H>) -> bool;
    fn insert(&mut self, pos: &Pos<W, H>);
    fn remove(&mut self, pos: &Pos<W, H>);

    // Provided method
    fn set(&mut self, pos: &Pos<W, H>, add: bool) { ... }
}
Expand description

Trait that abstracts sets of Pos values

Required Methods§

source

fn contains(&self, pos: &Pos<W, H>) -> bool

Check if the provided Pos is in the set

source

fn insert(&mut self, pos: &Pos<W, H>)

Insert the provided Pos

source

fn remove(&mut self, pos: &Pos<W, H>)

Remove the provided Pos

Provided Methods§

source

fn set(&mut self, pos: &Pos<W, H>, add: bool)

Insert or remove the provided Pos

Implementations on Foreign Types§

source§

impl<const W: u16, const H: u16, const WORDS: usize, const SIZE: usize> SetPos<W, H, WORDS, SIZE> for BTreeSet<Pos<W, H>>

source§

fn contains(&self, pos: &Pos<W, H>) -> bool

source§

fn insert(&mut self, pos: &Pos<W, H>)

source§

fn remove(&mut self, pos: &Pos<W, H>)

source§

impl<const W: u16, const H: u16, const WORDS: usize, const SIZE: usize> SetPos<W, H, WORDS, SIZE> for HashSet<Pos<W, H>>

source§

fn contains(&self, pos: &Pos<W, H>) -> bool

source§

fn insert(&mut self, pos: &Pos<W, H>)

source§

fn remove(&mut self, pos: &Pos<W, H>)

Implementors§

source§

impl<const W: u16, const H: u16, const WORDS: usize, const SIZE: usize> SetPos<W, H, WORDS, SIZE> for Gridbool<W, H, WORDS>