Struct grid_2d::Grid
[−]
[src]
pub struct Grid<T> { /* fields omitted */ }
Methods
impl<T> Grid<T>
[src]
fn new_from_fn<F>(width: u32, height: u32, f: F) -> Self where
F: Fn(Coord) -> T,
[src]
F: Fn(Coord) -> T,
fn width(&self) -> u32
[src]
fn height(&self) -> u32
[src]
fn size(&self) -> Size
[src]
fn len(&self) -> usize
[src]
fn iter(&self) -> Iter<T>
[src]
fn iter_mut(&mut self) -> IterMut<T>
[src]
fn coords(&self) -> CoordIter
[src]
fn enumerate(&self) -> CoordEnumerate<T>
[src]
fn enumerate_mut(&mut self) -> CoordEnumerateMut<T>
[src]
fn coord_to_index(&self, coord: Coord) -> Option<usize>
[src]
fn get(&self, coord: Coord) -> Option<&T>
[src]
fn get_mut(&mut self, coord: Coord) -> Option<&mut T>
[src]
impl<T: Copy> Grid<T>
[src]
impl<T: Default> Grid<T>
[src]
fn new_default(width: u32, height: u32) -> Self
[src]
impl<T: From<Coord>> Grid<T>
[src]
fn new_from_coord(width: u32, height: u32) -> Self
[src]
Trait Implementations
impl<T: Debug> Debug for Grid<T>
[src]
impl<T: Clone> Clone for Grid<T>
[src]
fn clone(&self) -> Grid<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> Index<usize> for Grid<T>
[src]
type Output = T
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.