Trait gridsim::Neighborhood [−][src]
pub trait Neighborhood<T> { type Direction: Direction; type Iter: Iterator<Item = T>; type DirIter: Iterator<Item = (Self::Direction, T)>; fn new<F: FnMut(Self::Direction) -> T>(_: F) -> Self; fn iter(self) -> Self::Iter; fn dir_iter(self) -> Self::DirIter; }
A Neighborhood
contains all of your neighbors, which are each in their own Direction
.
Associated Types
type Direction: Direction
type Iter: Iterator<Item = T>
type DirIter: Iterator<Item = (Self::Direction, T)>
Required Methods
fn new<F: FnMut(Self::Direction) -> T>(_: F) -> Self
fn iter(self) -> Self::Iter
Iterate over all neighbor cells.
fn dir_iter(self) -> Self::DirIter
Iterate over all neighbor cells with their directions.
Implementors
impl<T> Neighborhood<T> for gridsim::moore::Neighbors<T> type Direction = Direction; type Iter = Chain<Chain<Chain<Once<T>, Once<T>>, Once<T>>, Once<T>>; type DirIter = Chain<Chain<Chain<Once<(Direction, T)>, Once<(Direction, T)>>, Once<(Direction, T)>>, Once<(Direction, T)>>;
impl<T> Neighborhood<T> for gridsim::neumann::Neighbors<T> type Direction = Direction; type Iter = Chain<Chain<Chain<Chain<Chain<Chain<Chain<Once<T>, Once<T>>, Once<T>>, Once<T>>, Once<T>>, Once<T>>, Once<T>>, Once<T>>; type DirIter = Chain<Chain<Chain<Chain<Chain<Chain<Chain<Once<(Direction, T)>, Once<(Direction, T)>>, Once<(Direction, T)>>, Once<(Direction, T)>>, Once<(Direction, T)>>, Once<(Direction, T)>>, Once<(Direction, T)>>, Once<(Direction, T)>>;