[][src]Trait grid_trait::grid3::Grid3

pub trait Grid3 {
    type Item;
    type XBound: RangeBounds<i32>;
    type YBound: RangeBounds<i32>;
    type ZBound: RangeBounds<i32>;
    fn x_bound(&self) -> Self::XBound;
fn y_bound(&self) -> Self::YBound;
fn z_bound(&self) -> Self::ZBound; 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>
, { ... } }

Top-level trait for 2D grids.

Associated Types

Loading content...

Required methods

fn x_bound(&self) -> Self::XBound

fn y_bound(&self) -> Self::YBound

fn z_bound(&self) -> Self::ZBound

Loading content...

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, 

Element by-value mapping.

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, 

Element by-value+coord mapping.

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.

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.

fn oob_handler<I, F>(self, handler: F) -> Grid3OobHandler<Self, I, F> where
    Self: Sized,
    I: From<Vector3<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, 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

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, 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

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,
    new_z_len: i32
) -> Grid3Slice<Self, Range0To, Range0To, Range0To> where
    Self: Sized,
    Self::XBound: Debug,
    Self::YBound: Debug,
    Self::ZBound: 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,
    new_z_len: i32
) -> Result<Grid3Slice<Self, Range0To, Range0To, Range0To>, Self> where
    Self: Sized,
    Self::XBound: Debug,
    Self::YBound: Debug,
    Self::ZBound: 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) -> Grid3Wrapping<Self> where
    Self: Sized,
    Self::XBound: BoundRange,
    Self::YBound: BoundRange,
    Self::ZBound: 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) -> ArrayGrid3<Self::Item> where
    Self: Grid3Get,
    Self::XBound: Into<Range0To>,
    Self::YBound: Into<Range0To>,
    Self::ZBound: Into<Range0To>, 

Collect a grid's elements into a heap allocation.

The grid must be bound from 0 to a finite limit.

Loading content...

Implementors

impl<'a, F, I, T> Grid3 for KolmoMutGrid3<'a, F, I, T> where
    F: Fn(I) -> &'a mut T,
    T: 'a,
    I: From<Vector3<i32>>, 
[src]

type Item = T

type XBound = RangeFull

type YBound = RangeFull

type ZBound = RangeFull

impl<'a, F, I, T> Grid3 for KolmoRefGrid3<'a, F, I, T> where
    F: Fn(I) -> &'a T,
    T: 'a,
    I: From<Vector3<i32>>, 
[src]

type Item = T

type XBound = RangeFull

type YBound = RangeFull

type ZBound = RangeFull

impl<F, I, T> Grid3 for KolmoGrid3<F, I, T> where
    F: Fn(I) -> T,
    I: From<Vector3<i32>>, 
[src]

type Item = T

type XBound = RangeFull

type YBound = RangeFull

type ZBound = RangeFull

impl<G> Grid3 for Grid3Flat<G> where
    G: Grid3,
    <G as Grid3>::Item: Grid3,
    <G as Grid3>::XBound: Clone,
    <G as Grid3>::YBound: Clone,
    <G as Grid3>::ZBound: Clone
[src]

type Item = <<G as Grid3>::Item as Grid3>::Item

type XBound = <G as Grid3>::XBound

type YBound = <G as Grid3>::YBound

type ZBound = <G as Grid3>::ZBound

impl<G> Grid3 for Grid3NewOrigin<G> where
    G: Grid3,
    <G as Grid3>::XBound: RangeBoundsPlus,
    <G as Grid3>::YBound: RangeBoundsPlus,
    <G as Grid3>::ZBound: RangeBoundsPlus
[src]

type Item = <G as Grid3>::Item

type XBound = <<G as Grid3>::XBound as RangeBoundsPlus>::Output

type YBound = <<G as Grid3>::YBound as RangeBoundsPlus>::Output

type ZBound = <<G as Grid3>::ZBound as RangeBoundsPlus>::Output

impl<G> Grid3 for Grid3Wrapping<G> where
    G: Grid3,
    <G as Grid3>::XBound: BoundRange,
    <G as Grid3>::YBound: BoundRange,
    <G as Grid3>::ZBound: BoundRange
[src]

type Item = <G as Grid3>::Item

type XBound = RangeFull

type YBound = RangeFull

type ZBound = RangeFull

impl<G, F, T> Grid3 for Grid3Map<G, F, T> where
    G: Grid3,
    F: Fn(<G as Grid3>::Item) -> T, 
[src]

type Item = T

type XBound = <G as Grid3>::XBound

type YBound = <G as Grid3>::YBound

type ZBound = <G as Grid3>::ZBound

impl<G, F, T, I> Grid3 for Grid3EnuMap<G, F, T, I> where
    G: Grid3,
    I: From<Vector3<i32>>,
    F: Fn(I, <G as Grid3>::Item) -> T, 
[src]

type Item = T

type XBound = <G as Grid3>::XBound

type YBound = <G as Grid3>::YBound

type ZBound = <G as Grid3>::ZBound

impl<G, I, F> Grid3 for Grid3OobHandler<G, I, F> where
    G: Grid3,
    I: From<Vector3<i32>>,
    F: Fn(I) -> <G as Grid3>::Item
[src]

type Item = <G as Grid3>::Item

type XBound = RangeFull

type YBound = RangeFull

type ZBound = RangeFull

impl<G, X, Y, Z> Grid3 for Grid3Slice<G, X, Y, Z> where
    G: Grid3,
    X: RangeBounds<i32> + Clone,
    Y: RangeBounds<i32> + Clone,
    Z: RangeBounds<i32> + Clone
[src]

type Item = <G as Grid3>::Item

type XBound = X

type YBound = Y

type ZBound = Z

impl<I, R, T, Fr, Fw> Grid3 for KolmoRwGrid3<I, R, T, Fr, Fw> where
    Fr: Fn(I, &R) -> &T,
    Fw: FnMut(I, &mut R) -> &mut T,
    I: From<Vector3<i32>>, 
[src]

type Item = T

type XBound = RangeFull

type YBound = RangeFull

type ZBound = RangeFull

impl<T> Grid3 for ArrayGrid3<T>[src]

type Item = T

type XBound = Range0To

type YBound = Range0To

type ZBound = Range0To

impl<T> Grid3 for Inline3x3x3Grid<T>[src]

type Item = T

type XBound = Range0To

type YBound = Range0To

type ZBound = Range0To

impl<T> Grid3 for T where
    T: Deref,
    <T as Deref>::Target: Grid3
[src]

type Item = <<T as Deref>::Target as Grid3>::Item

type XBound = <<T as Deref>::Target as Grid3>::XBound

type YBound = <<T as Deref>::Target as Grid3>::YBound

type ZBound = <<T as Deref>::Target as Grid3>::ZBound

Loading content...