pub struct Grid<T>(pub Vec<Vec<T>>);
Tuple Fields§
§0: Vec<Vec<T>>
Implementations§
Source§impl<T> Grid<T>
impl<T> Grid<T>
pub fn new(b: Vec<Vec<T>>) -> Self
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn idx(&self, x: usize, y: usize) -> Idx2D
pub fn get<Ix: TryInto<isize>>(&self, x: Ix, y: Ix) -> Option<&T>
pub fn get_mut<Ix: TryInto<isize>>(&mut self, x: Ix, y: Ix) -> Option<&mut T>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Grid<T>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more