Trait Grid2Ref

Source
pub trait Grid2Ref: Grid2 {
    // Required method
    fn idx<I>(&self, coord: I) -> &Self::Item
       where I: Into<Vector2<i32>>;

    // Provided method
    fn try_idx<I>(&self, coord: I) -> Option<&Self::Item>
       where I: Into<Vector2<i32>> { ... }
}
Expand description

2D grid read by reference.

Required Methods§

Source

fn idx<I>(&self, coord: I) -> &Self::Item
where I: Into<Vector2<i32>>,

Provided Methods§

Source

fn try_idx<I>(&self, coord: I) -> Option<&Self::Item>
where I: Into<Vector2<i32>>,

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, F, I, T> Grid2Ref for KolmoRefGrid2<'a, F, I, T>
where F: Fn(I) -> &'a T, T: 'a, I: From<Vector2<i32>>,

Source§

impl<G> Grid2Ref for Grid2Flat<G>
where G: Grid2 + Grid2Ref, <G as Grid2>::Item: Grid2 + Grid2Ref, <G as Grid2>::XBound: Clone, <G as Grid2>::YBound: Clone,

Source§

impl<G> Grid2Ref for Grid2NewOrigin<G>

Source§

impl<G> Grid2Ref for Grid2Wrapping<G>
where G: Grid2 + Grid2Ref, <G as Grid2>::XBound: BoundRange, <G as Grid2>::YBound: BoundRange,

Source§

impl<G, X, Y> Grid2Ref for Grid2Slice<G, X, Y>

Source§

impl<I, R, T, Fr, Fw> Grid2Ref for KolmoRwGrid2<I, R, T, Fr, Fw>
where Fr: Fn(I, &R) -> &T, Fw: FnMut(I, &mut R) -> &mut T, I: From<Vector2<i32>>,

Source§

impl<T> Grid2Ref for ArrayGrid2<T>

Source§

impl<T> Grid2Ref for Inline3x3Grid<T>

Source§

impl<T> Grid2Ref for T
where T: Deref, <T as Deref>::Target: Grid2Ref,