pub trait Grid3 {
type Item;
type XBound: RangeBounds<i32>;
type YBound: RangeBounds<i32>;
type ZBound: RangeBounds<i32>;
Show 15 methods
// Required methods
fn x_bound(&self) -> Self::XBound;
fn y_bound(&self) -> Self::YBound;
fn z_bound(&self) -> Self::ZBound;
// Provided methods
fn in_bounds<I>(&self, coord: I) -> bool
where I: Into<Vector3<i32>> { ... }
fn map<F, T>(self, func: F) -> Grid3Map<Self, F, T>
where Self: Sized,
F: Fn(Self::Item) -> T { ... }
fn enumap<I, F, T>(self, func: F) -> Grid3EnuMap<Self, F, T, I>
where Self: Sized,
I: From<Vector3<i32>>,
F: Fn(I, Self::Item) -> T { ... }
fn flatten<I>(self, stride: I) -> Grid3Flat<Self>
where Self: Sized,
Self::Item: Grid3,
Self::XBound: Clone + RangeBoundsTimes,
Self::YBound: Clone + RangeBoundsTimes,
Self::ZBound: Clone + RangeBoundsTimes,
I: Into<Vector3<i32>> { ... }
fn new_origin<I>(self, new_origin: I) -> Grid3NewOrigin<Self>
where Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
Self::ZBound: RangeBoundsPlus,
I: Into<Vector3<i32>> { ... }
fn oob_handler<I, F>(self, handler: F) -> Grid3OobHandler<Self, I, F>
where Self: Sized,
I: From<Vector3<i32>>,
F: Fn(I) -> Self::Item { ... }
fn subview<X, Y, Z>(
self,
new_x: X,
new_y: Y,
new_z: Z,
) -> Grid3Slice<Self, X, Y, Z>
where Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
Self::ZBound: Debug,
X: RangeBounds<i32> + Clone + Debug,
Y: RangeBounds<i32> + Clone + Debug,
Z: RangeBounds<i32> + Clone + Debug { ... }
fn try_subview<X, Y, Z>(
self,
new_x: X,
new_y: Y,
new_z: Z,
) -> Result<Grid3Slice<Self, X, Y, Z>, Self>
where Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
X: RangeBounds<i32> + Clone + Debug,
Y: RangeBounds<i32> + Clone + Debug,
Z: RangeBounds<i32> + Clone + Debug { ... }
fn subview_0to(
self,
new_x_len: i32,
new_y_len: i32,
new_z_len: i32,
) -> Grid3Slice<Self, Range0To, Range0To, Range0To>
where Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
Self::ZBound: Debug { ... }
fn try_subview_0to(
self,
new_x_len: i32,
new_y_len: i32,
new_z_len: i32,
) -> Result<Grid3Slice<Self, Range0To, Range0To, Range0To>, Self>
where Self: Sized,
Self::XBound: Debug,
Self::YBound: Debug,
Self::ZBound: Debug { ... }
fn wrapping(self) -> Grid3Wrapping<Self>
where Self: Sized,
Self::XBound: BoundRange,
Self::YBound: BoundRange,
Self::ZBound: BoundRange { ... }
fn collect(&self) -> ArrayGrid3<Self::Item>
where Self: Grid3Get,
Self::XBound: Into<Range0To>,
Self::YBound: Into<Range0To>,
Self::ZBound: Into<Range0To> { ... }
}
Expand description
Top-level trait for 2D grids.
Required Associated Types§
type Item
type XBound: RangeBounds<i32>
type YBound: RangeBounds<i32>
type ZBound: RangeBounds<i32>
Required Methods§
fn x_bound(&self) -> Self::XBound
fn y_bound(&self) -> Self::YBound
fn z_bound(&self) -> Self::ZBound
Provided Methods§
fn in_bounds<I>(&self, coord: I) -> bool
Sourcefn enumap<I, F, T>(self, func: F) -> Grid3EnuMap<Self, F, T, I>
fn enumap<I, F, T>(self, func: F) -> Grid3EnuMap<Self, F, T, I>
Element by-value+coord mapping.
Sourcefn flatten<I>(self, stride: I) -> Grid3Flat<Self>where
Self: Sized,
Self::Item: Grid3,
Self::XBound: Clone + RangeBoundsTimes,
Self::YBound: Clone + RangeBoundsTimes,
Self::ZBound: Clone + RangeBoundsTimes,
I: Into<Vector3<i32>>,
fn flatten<I>(self, stride: I) -> Grid3Flat<Self>where
Self: Sized,
Self::Item: Grid3,
Self::XBound: Clone + RangeBoundsTimes,
Self::YBound: Clone + RangeBoundsTimes,
Self::ZBound: Clone + RangeBoundsTimes,
I: Into<Vector3<i32>>,
Flattening a grid of grids with a regular stride.
Sourcefn new_origin<I>(self, new_origin: I) -> Grid3NewOrigin<Self>where
Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
Self::ZBound: RangeBoundsPlus,
I: Into<Vector3<i32>>,
fn new_origin<I>(self, new_origin: I) -> Grid3NewOrigin<Self>where
Self: Sized,
Self::XBound: RangeBoundsPlus,
Self::YBound: RangeBoundsPlus,
Self::ZBound: RangeBoundsPlus,
I: Into<Vector3<i32>>,
<0, 0> in this grid becomes new_origin in resultant grid.
Sourcefn oob_handler<I, F>(self, handler: F) -> Grid3OobHandler<Self, I, F>
fn oob_handler<I, F>(self, handler: F) -> Grid3OobHandler<Self, I, F>
Provide function to provide elments at out-of-bounds coordinates.
This produces an unbounded grid.
Sourcefn subview<X, Y, Z>(
self,
new_x: X,
new_y: Y,
new_z: Z,
) -> Grid3Slice<Self, X, Y, Z>
fn subview<X, Y, Z>( self, new_x: X, new_y: Y, new_z: Z, ) -> Grid3Slice<Self, X, Y, Z>
View a sub-rectangle of this grid.
If the new bounds are not a subset of the current bounds, this will panic.
Sourcefn try_subview<X, Y, Z>(
self,
new_x: X,
new_y: Y,
new_z: Z,
) -> Result<Grid3Slice<Self, X, Y, Z>, Self>
fn try_subview<X, Y, Z>( self, new_x: X, new_y: Y, new_z: Z, ) -> Result<Grid3Slice<Self, X, Y, Z>, Self>
View a sub-rectangle of this grid.
If the new bounds are not a subset of the current bounds, this will fail.
Sourcefn subview_0to(
self,
new_x_len: i32,
new_y_len: i32,
new_z_len: i32,
) -> Grid3Slice<Self, Range0To, Range0To, Range0To>
fn subview_0to( self, new_x_len: i32, new_y_len: i32, new_z_len: i32, ) -> Grid3Slice<Self, Range0To, Range0To, Range0To>
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.
Sourcefn try_subview_0to(
self,
new_x_len: i32,
new_y_len: i32,
new_z_len: i32,
) -> Result<Grid3Slice<Self, Range0To, Range0To, Range0To>, Self>
fn try_subview_0to( self, new_x_len: i32, new_y_len: i32, new_z_len: i32, ) -> Result<Grid3Slice<Self, Range0To, Range0To, Range0To>, Self>
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.
Sourcefn wrapping(self) -> Grid3Wrapping<Self>
fn wrapping(self) -> Grid3Wrapping<Self>
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.
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.