[][src]Trait gridsim::Neighborhood

pub trait Neighborhood<T>: FromIterator<T> {
    type Direction: Direction;
    type Iter: Iterator<Item = T>;
    type DirIter: Iterator<Item = (Self::Direction, T)>;
    fn new<F: FnMut(Self::Direction) -> T>(dir_map: 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)>

Loading content...

Required methods

fn new<F: FnMut(Self::Direction) -> T>(dir_map: 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.

Loading content...

Implementors

Loading content...