[−][src]Struct grid::Grid
Fields
rows: usize
cols: usize
cells: Vec<Vec<T>>
Methods
impl<T> Grid<T> where
T: Debug + Clone,
[src]
T: Debug + Clone,
impl<T> Grid<T> where
T: Debug,
[src]
T: Debug,
pub fn new_from(data: Vec<Vec<T>>) -> Self
[src]
pub fn iter(&self) -> impl Iterator<Item = &T>
[src]
pub fn rows(&self) -> impl Iterator<Item = &Vec<T>>
[src]
pub fn cols<'a>(&'a self) -> impl Iterator<Item = impl Iterator<Item = &'a T>>
[src]
pub fn get(&self, row_index: usize, col_index: usize) -> Option<&T>
[src]
pub fn eight_neighbors<'a>(
&'a self,
row_origin: usize,
col_origin: usize
) -> impl Iterator<Item = &'a T>
[src]
&'a self,
row_origin: usize,
col_origin: usize
) -> impl Iterator<Item = &'a T>
pub fn l1_dist(&self, pt1: GridPt, pt2: GridPt) -> usize
[src]
pub fn right_from(&self, row: usize, col: usize) -> impl Iterator<Item = &T>
[src]
pub fn left_from(&self, row: usize, col: usize) -> impl Iterator<Item = &T>
[src]
pub fn up_from(&self, row: usize, col: usize) -> impl Iterator<Item = &T>
[src]
pub fn down_from(&self, row: usize, col: usize) -> impl Iterator<Item = &T>
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,