[−][src]Trait grid_trait::grid2::Grid2
Top-level trait for 2D grids.
Associated Types
Loading content...Required methods
Loading content...Provided methods
fn in_bounds<I>(&self, coord: I) -> bool where
I: Into<Vector2<i32>>,
I: Into<Vector2<i32>>,
fn map<F, T>(self, func: F) -> Grid2Map<Self, F, T> where
Self: Sized,
F: Fn(Self::Item) -> T,
Self: Sized,
F: Fn(Self::Item) -> T,
Element by-value mapping.
fn enumap<I, F, T>(self, func: F) -> Grid2EnuMap<Self, F, T, I> where
Self: Sized,
I: From<Vector2<i32>>,
F: Fn(I, Self::Item) -> T,
Self: Sized,
I: From<Vector2<i32>>,
F: Fn(I, Self::Item) -> T,
Element by-value+coord mapping.
fn flatten<I>(self, stride: I) -> Grid2Flat<Self> where
Self: Sized,
Self::Item: Grid2,
Self::XBound: Clone + RangeBoundsTimes,
Self::YBound: Clone + RangeBoundsTimes,
I: Into<Vector2<i32>>,
Self: Sized,
Self::Item: Grid2,
Self::XBound: Clone + RangeBoundsTimes,
Self::YBound: Clone + RangeBoundsTimes,
I: Into<Vector2<i32>>,
Flattening a grid of grids with a regular stride.
fn new_origin<I>(self, new_origin: I) -> Grid2NewOrigin<Self> where
Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
I: Into<Vector2<i32>>,
Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
I: Into<Vector2<i32>>,
<0, 0> in this grid becomes new_origin in resultant grid.
fn oob_handler<I, F>(self, handler: F) -> Grid2OobHandler<Self, I, F> where
Self: Sized,
I: From<Vector2<i32>>,
F: Fn(I) -> Self::Item,
Self: Sized,
I: From<Vector2<i32>>,
F: Fn(I) -> Self::Item,
Provide function to provide elments at out-of-bounds coordinates.
This produces an unbounded grid.
fn subview<X, Y>(self, new_x: X, new_y: Y) -> Grid2Slice<Self, X, Y> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
X: RangeBounds<i32> + Clone + Debug,
Y: RangeBounds<i32> + Clone + Debug,
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
X: RangeBounds<i32> + Clone + Debug,
Y: RangeBounds<i32> + Clone + Debug,
View a sub-rectangle of this grid.
If the new bounds are not a subset of the current bounds, this will panic.
fn try_subview<X, Y>(
self,
new_x: X,
new_y: Y
) -> Result<Grid2Slice<Self, X, Y>, Self> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
X: RangeBounds<i32> + Clone + Debug,
Y: RangeBounds<i32> + Clone + Debug,
self,
new_x: X,
new_y: Y
) -> Result<Grid2Slice<Self, X, Y>, Self> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
X: RangeBounds<i32> + Clone + Debug,
Y: RangeBounds<i32> + Clone + Debug,
View a sub-rectangle of this grid.
If the new bounds are not a subset of the current bounds, this will fail.
fn subview_0to(
self,
new_x_len: i32,
new_y_len: i32
) -> Grid2Slice<Self, Range0To, Range0To> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
self,
new_x_len: i32,
new_y_len: i32
) -> Grid2Slice<Self, Range0To, Range0To> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
View a sub-rectangle of this grid, beginning at origin.
If the new bounds are not a subset of the current bounds, this will panic.
fn try_subview_0to(
self,
new_x_len: i32,
new_y_len: i32
) -> Result<Grid2Slice<Self, Range0To, Range0To>, Self> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
self,
new_x_len: i32,
new_y_len: i32
) -> Result<Grid2Slice<Self, Range0To, Range0To>, Self> where
Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
View a sub-rectangle of this grid, beginning at origin.
If the new bounds are not a subset of the current bounds, this will fail.
fn wrapping(self) -> Grid2Wrapping<Self> where
Self: Sized,
Self::XBound: BoundRange,
Self::YBound: BoundRange,
Self: Sized,
Self::XBound: BoundRange,
Self::YBound: BoundRange,
View of this grid which wraps around the edges.
The input grid must be bounded in all directions, and the output grid is completely unbounded.
fn collect(&self) -> ArrayGrid2<Self::Item> where
Self: Grid2Get,
Self::XBound: Into<Range0To>,
Self::YBound: Into<Range0To>,
Self: Grid2Get,
Self::XBound: Into<Range0To>,
Self::YBound: Into<Range0To>,
Collect a grid's elements into a heap allocation.
The grid must be bound from 0 to a finite limit.
Implementors
impl<'a, F, I, T> Grid2 for KolmoMutGrid2<'a, F, I, T> where
F: Fn(I) -> &'a mut T,
T: 'a,
I: From<Vector2<i32>>,
[src]
F: Fn(I) -> &'a mut T,
T: 'a,
I: From<Vector2<i32>>,
type Item = T
type XBound = RangeFull
type YBound = RangeFull
fn x_bound(&self) -> RangeFull
[src]
fn y_bound(&self) -> RangeFull
[src]
impl<'a, F, I, T> Grid2 for KolmoRefGrid2<'a, F, I, T> where
F: Fn(I) -> &'a T,
T: 'a,
I: From<Vector2<i32>>,
[src]
F: Fn(I) -> &'a T,
T: 'a,
I: From<Vector2<i32>>,
type Item = T
type XBound = RangeFull
type YBound = RangeFull
fn x_bound(&self) -> RangeFull
[src]
fn y_bound(&self) -> RangeFull
[src]
impl<F, I, T> Grid2 for KolmoGrid2<F, I, T> where
F: Fn(I) -> T,
I: From<Vector2<i32>>,
[src]
F: Fn(I) -> T,
I: From<Vector2<i32>>,
type Item = T
type XBound = RangeFull
type YBound = RangeFull
fn x_bound(&self) -> RangeFull
[src]
fn y_bound(&self) -> RangeFull
[src]
impl<G> Grid2 for Grid2Flat<G> where
G: Grid2,
<G as Grid2>::Item: Grid2,
<G as Grid2>::XBound: Clone,
<G as Grid2>::YBound: Clone,
[src]
G: Grid2,
<G as Grid2>::Item: Grid2,
<G as Grid2>::XBound: Clone,
<G as Grid2>::YBound: Clone,
type Item = <<G as Grid2>::Item as Grid2>::Item
type XBound = <G as Grid2>::XBound
type YBound = <G as Grid2>::YBound
fn x_bound(&self) -> <G as Grid2>::XBound
[src]
fn y_bound(&self) -> <G as Grid2>::YBound
[src]
impl<G> Grid2 for Grid2NewOrigin<G> where
G: Grid2,
<G as Grid2>::XBound: RangeBoundsPlus,
<G as Grid2>::YBound: RangeBoundsPlus,
[src]
G: Grid2,
<G as Grid2>::XBound: RangeBoundsPlus,
<G as Grid2>::YBound: RangeBoundsPlus,
type Item = <G as Grid2>::Item
type XBound = <<G as Grid2>::XBound as RangeBoundsPlus>::Output
type YBound = <<G as Grid2>::YBound as RangeBoundsPlus>::Output
fn x_bound(&self) -> Self::XBound
[src]
fn y_bound(&self) -> Self::YBound
[src]
impl<G> Grid2 for Grid2Wrapping<G> where
G: Grid2,
<G as Grid2>::XBound: BoundRange,
<G as Grid2>::YBound: BoundRange,
[src]
G: Grid2,
<G as Grid2>::XBound: BoundRange,
<G as Grid2>::YBound: BoundRange,
type Item = <G as Grid2>::Item
type XBound = RangeFull
type YBound = RangeFull
fn x_bound(&self) -> RangeFull
[src]
fn y_bound(&self) -> RangeFull
[src]
impl<G, F, T> Grid2 for Grid2Map<G, F, T> where
G: Grid2,
F: Fn(<G as Grid2>::Item) -> T,
[src]
G: Grid2,
F: Fn(<G as Grid2>::Item) -> T,
type Item = T
type XBound = <G as Grid2>::XBound
type YBound = <G as Grid2>::YBound
fn x_bound(&self) -> Self::XBound
[src]
fn y_bound(&self) -> Self::YBound
[src]
impl<G, F, T, I> Grid2 for Grid2EnuMap<G, F, T, I> where
G: Grid2,
I: From<Vector2<i32>>,
F: Fn(I, <G as Grid2>::Item) -> T,
[src]
G: Grid2,
I: From<Vector2<i32>>,
F: Fn(I, <G as Grid2>::Item) -> T,
type Item = T
type XBound = <G as Grid2>::XBound
type YBound = <G as Grid2>::YBound
fn x_bound(&self) -> Self::XBound
[src]
fn y_bound(&self) -> Self::YBound
[src]
impl<G, I, F> Grid2 for Grid2OobHandler<G, I, F> where
G: Grid2,
I: From<Vector2<i32>>,
F: Fn(I) -> <G as Grid2>::Item,
[src]
G: Grid2,
I: From<Vector2<i32>>,
F: Fn(I) -> <G as Grid2>::Item,
type Item = <G as Grid2>::Item
type XBound = RangeFull
type YBound = RangeFull
fn x_bound(&self) -> RangeFull
[src]
fn y_bound(&self) -> RangeFull
[src]
impl<G, X, Y> Grid2 for Grid2Slice<G, X, Y> where
G: Grid2,
X: RangeBounds<i32> + Clone,
Y: RangeBounds<i32> + Clone,
[src]
G: Grid2,
X: RangeBounds<i32> + Clone,
Y: RangeBounds<i32> + Clone,
type Item = <G as Grid2>::Item
type XBound = X
type YBound = Y
fn x_bound(&self) -> Self::XBound
[src]
fn y_bound(&self) -> Self::YBound
[src]
impl<I, R, T, Fr, Fw> Grid2 for KolmoRwGrid2<I, R, T, Fr, Fw> where
Fr: Fn(I, &R) -> &T,
Fw: FnMut(I, &mut R) -> &mut T,
I: From<Vector2<i32>>,
[src]
Fr: Fn(I, &R) -> &T,
Fw: FnMut(I, &mut R) -> &mut T,
I: From<Vector2<i32>>,
type Item = T
type XBound = RangeFull
type YBound = RangeFull
fn x_bound(&self) -> RangeFull
[src]
fn y_bound(&self) -> RangeFull
[src]
impl<T> Grid2 for ArrayGrid2<T>
[src]
type Item = T
type XBound = Range0To
type YBound = Range0To
fn x_bound(&self) -> Range0To
[src]
fn y_bound(&self) -> Range0To
[src]
impl<T> Grid2 for Inline3x3Grid<T>
[src]
type Item = T
type XBound = Range0To
type YBound = Range0To
fn x_bound(&self) -> Range0To
[src]
fn y_bound(&self) -> Range0To
[src]
impl<T> Grid2 for T where
T: Deref,
<T as Deref>::Target: Grid2,
[src]
T: Deref,
<T as Deref>::Target: Grid2,