Struct gridsim::moore::Neighbors [−][src]
pub struct Neighbors<T> { pub right: T, pub up: T, pub left: T, pub down: T, }
Fields
right: T
up: T
left: T
down: T
Trait Implementations
impl<T: Copy> Copy for Neighbors<T>
[src]
impl<T: Copy> Copy for Neighbors<T>
impl<T: Clone> Clone for Neighbors<T>
[src]
impl<T: Clone> Clone for Neighbors<T>
fn clone(&self) -> Neighbors<T>
[src]
fn clone(&self) -> Neighbors<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Neighbors<T>
[src]
impl<T: Debug> Debug for Neighbors<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Default> Default for Neighbors<T>
[src]
impl<T: Default> Default for Neighbors<T>
impl<T> Index<Direction> for Neighbors<T>
[src]
impl<T> Index<Direction> for Neighbors<T>
type Output = T
The returned type after indexing.
fn index(&self, ix: Direction) -> &T
[src]
fn index(&self, ix: Direction) -> &T
Performs the indexing (container[index]
) operation.
impl<T> IndexMut<Direction> for Neighbors<T>
[src]
impl<T> IndexMut<Direction> for Neighbors<T>
fn index_mut(&mut self, ix: Direction) -> &mut T
[src]
fn index_mut(&mut self, ix: Direction) -> &mut T
Performs the mutable indexing (container[index]
) operation.
impl<T> Neighborhood<T> for Neighbors<T>
[src]
impl<T> Neighborhood<T> for 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)>>
fn new<F: FnMut(Direction) -> T>(f: F) -> Neighbors<T>
[src]
fn new<F: FnMut(Direction) -> T>(f: F) -> Neighbors<T>
fn iter(self) -> Self::Iter
[src]
fn iter(self) -> Self::Iter
Iterate over all neighbor cells.
fn dir_iter(self) -> Self::DirIter
[src]
fn dir_iter(self) -> Self::DirIter
Iterate over all neighbor cells with their directions.
impl<'a, T> From<Neighbors<&'a T>> for Neighbors<T> where
T: Clone,
[src]
impl<'a, T> From<Neighbors<&'a T>> for Neighbors<T> where
T: Clone,
impl<'a, C, S> GetNeighbors<'a, usize, Neighbors<&'a C>> for SquareGrid<'a, S> where
S: Sim<'a, Cell = C>,
[src]
impl<'a, C, S> GetNeighbors<'a, usize, Neighbors<&'a C>> for SquareGrid<'a, S> where
S: Sim<'a, Cell = C>,
fn get_neighbors(&'a self, ix: usize) -> Neighbors<&'a C>
[src]
fn get_neighbors(&'a self, ix: usize) -> Neighbors<&'a C>
impl<'a, S, M> TakeMoveNeighbors<usize, Neighbors<M>> for SquareGrid<'a, S> where
S: Sim<'a, Move = M, MoveNeighbors = Neighbors<M>>,
[src]
impl<'a, S, M> TakeMoveNeighbors<usize, Neighbors<M>> for SquareGrid<'a, S> where
S: Sim<'a, Move = M, MoveNeighbors = Neighbors<M>>,
unsafe fn take_move_neighbors(&self, ix: usize) -> Neighbors<M>
[src]
unsafe fn take_move_neighbors(&self, ix: usize) -> Neighbors<M>
This should be called exactly once for every index, making it unsafe. Read more