pub trait MapPos<Item, P: PosT, const WORDS: usize, const SIZE: usize> {
// Required methods
fn new(item: Item) -> Self;
fn get(&self, pos: &P) -> &Item;
fn set(&mut self, pos: P, item: Item);
}Expand description
Trait that abstracts maps with super::pos::Pos indexes
The generic parameters allow us to support implementing Grid.
Required Methods§
Sourcefn get(&self, pos: &P) -> &Item
fn get(&self, pos: &P) -> &Item
Get the item corresponding to the provided super::pos::Pos
Sourcefn set(&mut self, pos: P, item: Item)
fn set(&mut self, pos: P, item: Item)
Set the item corresponding to the provided super::pos::Pos
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.