Fields
ncols: u16
nrows: u16
data: Box<[T]>
Implementations
sourceimpl<T> Grid<T>
impl<T> Grid<T>
pub fn filled_with<F>(ncols: u16, nrows: u16, fun: F) -> Self where
F: FnMut() -> T,
pub fn filled_with_xy<F>(ncols: u16, nrows: u16, fun: F) -> Self where
F: FnMut(u16, u16) -> T,
pub fn nrows(&self) -> u16
pub fn ncols(&self) -> u16
fn index(&self, col: u16, row: u16) -> usize
pub fn get(&self, col: u16, row: u16) -> &T
pub fn get_mut(&mut self, col: u16, row: u16) -> &mut T
pub fn contains(&self, col: u16, row: u16) -> bool
pub fn as_slice(&self) -> &[T]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn as_slice_mut(&mut self) -> &mut [T]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn iter(&self) -> impl ExactSizeIterator<Item = &T>
pub fn iter_mut(&mut self) -> impl ExactSizeIterator<Item = &mut T>
pub fn iter_xy(&self) -> impl Iterator<Item = (u16, u16, &T)>
pub fn iter_xy_mut(&mut self) -> impl Iterator<Item = (u16, u16, &mut T)>
sourceimpl<T> Grid<T> where
T: Default + Clone,
impl<T> Grid<T> where
T: Default + Clone,
pub fn resize_empty(&mut self, ncols: u16, nrows: u16)
pub fn resize_empty_like<U>(&mut self, grid: &Grid<U>)
Trait Implementations
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>
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more