Struct CubeSphereGrid

Source
pub struct CubeSphereGrid<T, const S: usize> { /* private fields */ }
Expand description

A grid that wraps a cube around a sphere in order to determine grid positions.

§Type Parameters.

  • T - The type of element stored in each grid cell.

§Constant Parameters

  • S - The size of each side of each face.

Trait Implementations§

Source§

impl<T: Clone, const S: usize> Clone for CubeSphereGrid<T, S>

Source§

fn clone(&self) -> CubeSphereGrid<T, S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, const S: usize> Debug for CubeSphereGrid<T, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, const S: usize> Default for CubeSphereGrid<T, S>

Source§

fn default() -> CubeSphereGrid<T, S>

Returns the “default value” for a type. Read more
Source§

impl<T: Hash, const S: usize> Hash for CubeSphereGrid<T, S>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T, const S: usize> Index<CubeSpherePoint<S>> for CubeSphereGrid<T, S>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: CubeSpherePoint<S>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T, const S: usize> IndexMut<CubeSpherePoint<S>> for CubeSphereGrid<T, S>

Source§

fn index_mut(&mut self, index: CubeSpherePoint<S>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T, const S: usize> IntoIterator for CubeSphereGrid<T, S>

Source§

type Item = (CubeSpherePoint<S>, T)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<CubeSphereGrid<T, S> as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: PartialEq, const S: usize> PartialEq for CubeSphereGrid<T, S>

Source§

fn eq(&self, other: &CubeSphereGrid<T, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Debug, const S: usize> SurfaceGrid<T> for CubeSphereGrid<T, S>

Source§

type Point = CubeSpherePoint<S>

The type of a point on this grid.
Source§

fn from_fn<F: FnMut(&Self::Point) -> T>(f: F) -> Self

Creates a new surface grid by calling the specified function for each point in the grid. Read more
Source§

fn from_fn_par<F: Fn(&Self::Point) -> T + Send + Sync>(f: F) -> Self
where T: Send + Sync,

Creates a new surface grid by calling the specified function in parallel for each point in the grid. Read more
Source§

fn set_from_fn<F: FnMut(&Self::Point) -> T>(&mut self, f: F)

Updates this surface grid by calling the specified function for each point in the grid. Read more
Source§

fn set_from_fn_par<F: Fn(&Self::Point) -> T + Send + Sync>(&mut self, f: F)
where T: Send + Sync,

Updates this surface grid by calling the specified function for each point in the grid in parallel. Read more
Source§

fn iter<'a>(&'a self) -> impl Iterator<Item = (Self::Point, &'a T)>
where T: 'a,

Iterates over the points in this grid and their values.
Source§

fn par_iter<'a>(&'a self) -> impl ParallelIterator<Item = (Self::Point, &'a T)>
where T: 'a + Send + Sync,

Iterates over the points in this grid and their values in parallel.
Source§

fn points(&self) -> impl Iterator<Item = Self::Point>

Iterates over the points in this grid.
Source§

fn par_points(&self) -> impl ParallelIterator<Item = Self::Point>

Iterates over the points in this grid in parallel.
Source§

fn for_each(&mut self, f: impl FnMut(&mut T))

Calls a function for each element on this grid. Read more
Source§

fn for_each_with_position(&mut self, f: impl FnMut(&Self::Point, &mut T))

Calls a function for each element on this grid with the position. Read more
Source§

fn par_for_each(&mut self, f: impl Fn(&mut T) + Sync)
where T: Send + Sync,

Calls a function for each element on this grid in parallel. Read more
Source§

fn par_for_each_with_position( &mut self, f: impl Fn(&Self::Point, &mut T) + Sync, )
where T: Send + Sync,

Calls a function for each element on this grid with the position in parallel. Read more
Source§

fn map_neighbours<F: FnMut(&T, &T, &T, &T, &T) -> T>(&self, f: F) -> Self
where Self: Sized,

Applies a function to each cell and its direct neighbours. Read more
Source§

fn map_neighbours_diagonals<F: FnMut(&T, &T, &T, &T, &T, &T, &T, &T, &T) -> T>( &self, f: F, ) -> Self
where Self: Sized,

Applies a function to each cell and its direct neighbours including diagonals. Read more
Source§

fn map_neighbours_par<F: Fn(&T, &T, &T, &T, &T) -> T + Send + Sync>( &self, f: F, ) -> Self
where Self: Sized + Sync, T: Send + Sync,

Applies a function in parallel to each cell and its direct neighbours. Read more
Source§

fn map_neighbours_diagonals_par<F: Fn(&T, &T, &T, &T, &T, &T, &T, &T, &T) -> T + Send + Sync>( &self, f: F, ) -> Self
where Self: Sized + Sync, T: Send + Sync,

Applies a function in parallel to each cell and its direct neighbours including diagonals. Read more
Source§

fn map_neighbours_with_position<F: FnMut(&T, &Self::Point, &T, &T, &T, &T) -> T>( &self, f: F, ) -> Self
where Self: Sized,

Applies a function to each cell and its direct neighbours providing the current point. Read more
Source§

fn map_neighbours_diagonals_with_position<F: FnMut(&Self::Point, &T, &T, &T, &T, &T, &T, &T, &T, &T) -> T>( &self, f: F, ) -> Self
where Self: Sized,

Applies a function to each cell and its direct neighbours including diagonals providing the current point. Read more
Source§

fn map_neighbours_par_with_position<F: Fn(&T, &Self::Point, &T, &T, &T, &T) -> T + Send + Sync>( &self, f: F, ) -> Self
where Self: Sized + Sync, T: Send + Sync,

Applies a function in parallel to each cell and its direct neighbours providing the current point. Read more
Source§

fn map_neighbours_diagonals_par_with_position<F: Fn(&Self::Point, &T, &T, &T, &T, &T, &T, &T, &T, &T) -> T + Send + Sync>( &self, f: F, ) -> Self
where Self: Sized + Sync, T: Send + Sync,

Applies a function in parallel to each cell and its direct neighbours including diagonals providing the current point. Read more
Source§

fn set_from_neighbours<U, G: SurfaceGrid<U, Point = Self::Point>, F: FnMut(&U, &U, &U, &U, &U) -> T>( &mut self, source: &G, f: F, )

Applies a function to each cell and its direct neighbours. Read more
Source§

fn set_from_neighbours_diagonals<U, G: SurfaceGrid<U, Point = Self::Point>, F: FnMut(&U, &U, &U, &U, &U, &U, &U, &U, &U) -> T>( &mut self, source: &G, f: F, )

Applies a function to each cell and its direct neighbours including diagonals. Read more
Source§

fn set_from_neighbours_par<U, G: SurfaceGrid<U, Point = Self::Point> + Sync, F: Fn(&U, &U, &U, &U, &U) -> T + Send + Sync>( &mut self, source: &G, f: F, )
where T: Send + Sync,

Applies a function to each cell and its direct neighbours in parallel. Read more
Source§

fn set_from_neighbours_diagonals_par<U, G: SurfaceGrid<U, Point = Self::Point> + Sync, F: Fn(&U, &U, &U, &U, &U, &U, &U, &U, &U) -> T + Send + Sync>( &mut self, source: &G, f: F, )
where T: Send + Sync,

Applies a function to each cell and its direct neighbours including diagonals in parallel. Read more
Source§

fn set_from_neighbours_with_position<U, G: SurfaceGrid<U, Point = Self::Point>, F: FnMut(&U, &Self::Point, &U, &U, &U, &U) -> T>( &mut self, source: &G, f: F, )

Applies a function to each cell and its direct neighbours providing the position. Read more
Source§

fn set_from_neighbours_diagonals_with_position<U, G: SurfaceGrid<U, Point = Self::Point>, F: FnMut(&Self::Point, &U, &U, &U, &U, &U, &U, &U, &U, &U) -> T>( &mut self, source: &G, f: F, )

Applies a function to each cell and its direct neighbours including diagonals. Read more
Source§

fn set_from_neighbours_par_with_position<U, G: SurfaceGrid<U, Point = Self::Point> + Sync, F: Fn(&U, &Self::Point, &U, &U, &U, &U) -> T + Send + Sync>( &mut self, source: &G, f: F, )
where T: Send + Sync,

Applies a function to each cell and its direct neighbours in parallel. Read more
Source§

fn set_from_neighbours_diagonals_par_with_position<U, G: SurfaceGrid<U, Point = Self::Point> + Sync, F: Fn(&Self::Point, &U, &U, &U, &U, &U, &U, &U, &U, &U) -> T + Send + Sync>( &mut self, source: &G, f: F, )
where T: Send + Sync,

Applies a function to each cell and its direct neighbours including diagonals in parallel. Read more
Source§

impl<T: Eq, const S: usize> Eq for CubeSphereGrid<T, S>

Source§

impl<T, const S: usize> StructuralPartialEq for CubeSphereGrid<T, S>

Auto Trait Implementations§

§

impl<T, const S: usize> Freeze for CubeSphereGrid<T, S>

§

impl<T, const S: usize> RefUnwindSafe for CubeSphereGrid<T, S>
where T: RefUnwindSafe,

§

impl<T, const S: usize> Send for CubeSphereGrid<T, S>
where T: Send,

§

impl<T, const S: usize> Sync for CubeSphereGrid<T, S>
where T: Sync,

§

impl<T, const S: usize> Unpin for CubeSphereGrid<T, S>

§

impl<T, const S: usize> UnwindSafe for CubeSphereGrid<T, S>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.