pub struct Grid<T> { /* private fields */ }Implementations
sourceimpl<T> Grid<T>
impl<T> Grid<T>
pub fn new(width: u32, height: u32) -> Grid<T>
pub fn get(&self, coord: Coord) -> Option<&T>
pub fn get_mut(&mut self, coord: Coord) -> Option<&mut T>
pub fn insert(&mut self, coord: Coord, val: T) -> Option<T>
pub fn contains(&self, coord: Coord) -> bool
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn iter(&self) -> impl Iterator<Item = (Coord, &T)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (Coord, &mut T)>
pub fn into_iter(self) -> impl Iterator<Item = (Coord, T)>
Auto Trait Implementations
impl<T> RefUnwindSafe for Grid<T> where
T: RefUnwindSafe,
impl<T> Send for Grid<T> where
T: Send,
impl<T> Sync for Grid<T> where
T: Sync,
impl<T> Unpin for Grid<T> where
T: Unpin,
impl<T> UnwindSafe for Grid<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more