MapPosition

Trait MapPosition 

Source
pub trait MapPosition<const DIMS: usize>:
    Eq
    + Hash
    + Sized
    + Copy
    + Clone
    + Borrow<Self> {
    type Key: PositionKey;

    // Required methods
    fn get_dims(&self) -> [Self::Key; DIMS];
    fn from_dims(dims: [Self::Key; DIMS]) -> Self;
    fn adjacents<BS: Borrow<Self>, AG: AdjacencyGenerator<2, Input = BS>>(
        borrowed: BS,
    ) -> AG::Output;
}

Required Associated Types§

Required Methods§

Source

fn get_dims(&self) -> [Self::Key; DIMS]

Source

fn from_dims(dims: [Self::Key; DIMS]) -> Self

Source

fn adjacents<BS: Borrow<Self>, AG: AdjacencyGenerator<2, Input = BS>>( borrowed: BS, ) -> AG::Output

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, P: PositionKey + 'a> MapPosition<2> for Position2D<P>

Source§

type Key = P