pub struct ArrayGrid2<T> { /* private fields */ }
Expand description
Heap-allocated array implementation of Grid2.
Implementations§
Trait Implementations§
Source§impl<T> Grid2 for ArrayGrid2<T>
impl<T> Grid2 for ArrayGrid2<T>
type Item = T
type XBound = Range0To
type YBound = Range0To
fn x_bound(&self) -> Range0To
fn y_bound(&self) -> Range0To
fn in_bounds<I>(&self, coord: I) -> bool
Source§fn enumap<I, F, T>(self, func: F) -> Grid2EnuMap<Self, F, T, I>
fn enumap<I, F, T>(self, func: F) -> Grid2EnuMap<Self, F, T, I>
Element by-value+coord mapping.
Source§fn flatten<I>(self, stride: I) -> Grid2Flat<Self>
fn flatten<I>(self, stride: I) -> Grid2Flat<Self>
Flattening a grid of grids with a regular stride.
Source§fn new_origin<I>(self, new_origin: I) -> Grid2NewOrigin<Self>where
Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
I: Into<Vector2<i32>>,
fn new_origin<I>(self, new_origin: I) -> Grid2NewOrigin<Self>where
Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
I: Into<Vector2<i32>>,
<0, 0> in this grid becomes new_origin in resultant grid.
Source§fn oob_handler<I, F>(self, handler: F) -> Grid2OobHandler<Self, I, F>
fn oob_handler<I, F>(self, handler: F) -> Grid2OobHandler<Self, I, F>
Provide function to provide elments at out-of-bounds coordinates. Read more
Source§fn subview<X, Y>(self, new_x: X, new_y: Y) -> Grid2Slice<Self, X, Y>
fn subview<X, Y>(self, new_x: X, new_y: Y) -> Grid2Slice<Self, X, Y>
View a sub-rectangle of this grid. Read more
Source§fn try_subview<X, Y>(
self,
new_x: X,
new_y: Y,
) -> Result<Grid2Slice<Self, X, Y>, Self>
fn try_subview<X, Y>( self, new_x: X, new_y: Y, ) -> Result<Grid2Slice<Self, X, Y>, Self>
View a sub-rectangle of this grid. Read more
Source§fn subview_0to(
self,
new_x_len: i32,
new_y_len: i32,
) -> Grid2Slice<Self, Range0To, Range0To>
fn subview_0to( self, new_x_len: i32, new_y_len: i32, ) -> Grid2Slice<Self, Range0To, Range0To>
View a sub-rectangle of this grid, beginning at origin. Read more
Source§fn try_subview_0to(
self,
new_x_len: i32,
new_y_len: i32,
) -> Result<Grid2Slice<Self, Range0To, Range0To>, Self>
fn try_subview_0to( self, new_x_len: i32, new_y_len: i32, ) -> Result<Grid2Slice<Self, Range0To, Range0To>, Self>
View a sub-rectangle of this grid, beginning at origin. Read more
Source§fn wrapping(self) -> Grid2Wrapping<Self>
fn wrapping(self) -> Grid2Wrapping<Self>
View of this grid which wraps around the edges. Read more
Source§impl<T: Clone> Grid2Get for ArrayGrid2<T>
impl<T: Clone> Grid2Get for ArrayGrid2<T>
Source§impl<T> Grid2Mut for ArrayGrid2<T>
impl<T> Grid2Mut for ArrayGrid2<T>
Source§impl<T> Grid2Ref for ArrayGrid2<T>
impl<T> Grid2Ref for ArrayGrid2<T>
Auto Trait Implementations§
impl<T> Freeze for ArrayGrid2<T>
impl<T> RefUnwindSafe for ArrayGrid2<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayGrid2<T>where
T: Send,
impl<T> Sync for ArrayGrid2<T>where
T: Sync,
impl<T> Unpin for ArrayGrid2<T>
impl<T> UnwindSafe for ArrayGrid2<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more