Struct cell_map::CellMap[][src]

pub struct CellMap<L, T> where
    L: Layer
{ /* fields omitted */ }

Provides a many-layer 2D map of cellular data.

Implementations

impl<L, T> CellMap<L, T> where
    L: Layer
[src]

pub fn cell_size(&self) -> Vector2<f64>[src]

Returns the size of the cells in the map.

pub fn num_cells(&self) -> Vector2<usize>[src]

Returns the number of cells in each direction of the map.

pub fn iter_mut(&mut self) -> CellIterMut<'_, L, T>

Notable traits for CellIterMut<'c, L, T>

impl<'c, L: Layer, T: Clone> Iterator for CellIterMut<'c, L, T> type Item = &'c mut T;
[src]

Returns a mutable iterator over each cell in each layer of the map.

pub fn window_iter(
    &self,
    semi_window_size: Vector2<usize>
) -> WindowIter<'_, L, T>

Notable traits for WindowIter<'c, L, T>

impl<'c, L, T> Iterator for WindowIter<'c, L, T> where
    L: Layer,
    T: Clone
type Item = ArrayView2<'c, T>;
[src]

Returns an iterator over windows of cells in the map.

The semi_window_size is half the size of the window in the x and y axes, not including the central cell. E.g. to have a window which is in total 5x5, the semi_window_size needs to be Vector2::new(2, 2).

pub fn window_iter_mut(
    &mut self,
    semi_window_size: Vector2<usize>
) -> WindowIterMut<'_, L, T>

Notable traits for WindowIterMut<'c, L, T>

impl<'c, L, T> Iterator for WindowIterMut<'c, L, T> where
    L: Layer
type Item = ArrayViewMut2<'c, T>;
[src]

Returns a mutable iterator over windows of cells in the map.

The semi_window_size is half the size of the window in the x and y axes, not including the central cell. E.g. to have a window which is in total 5x5, the semi_window_size needs to be Vector2::new(2, 2).

impl<L, T> CellMap<L, T> where
    L: Layer,
    T: Clone
[src]

pub fn new_from_elem(params: CellMapParams, elem: T) -> Self[src]

Creates a new CellMap from the given params, filling each cell with elem.

pub fn iter(&self) -> CellIter<'_, L, T>

Notable traits for CellIter<'c, L, T>

impl<'c, L: Layer, T: Clone> Iterator for CellIter<'c, L, T> type Item = T;
[src]

Produces an iterator of owned items over each cell in each layer of self.

impl<L, T> CellMap<L, T> where
    L: Layer,
    T: Default + Clone
[src]

pub fn new(params: CellMapParams) -> Self[src]

Creates a new CellMap from the given params, filling each cell with T::default().

Trait Implementations

impl<L: Clone, T: Clone> Clone for CellMap<L, T> where
    L: Layer
[src]

fn clone(&self) -> CellMap<L, T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<L: Debug, T: Debug> Debug for CellMap<L, T> where
    L: Layer
[src]

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

Formats the value using the given formatter. Read more

impl<'de, L, T> Deserialize<'de> for CellMap<L, T> where
    L: Layer,
    T: Deserialize<'de>, 
[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<L, T> Index<L> for CellMap<L, T> where
    L: Layer
[src]

type Output = Array2<T>

The returned type after indexing.

fn index(&self, index: L) -> &Self::Output[src]

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

impl<L, T> Serialize for CellMap<L, T> where
    L: Layer,
    T: Serialize
[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl<L, T> RefUnwindSafe for CellMap<L, T> where
    L: RefUnwindSafe,
    T: RefUnwindSafe

impl<L, T> Send for CellMap<L, T> where
    L: Send,
    T: Send

impl<L, T> Sync for CellMap<L, T> where
    L: Sync,
    T: Sync

impl<L, T> Unpin for CellMap<L, T> where
    L: Unpin

impl<L, T> UnwindSafe for CellMap<L, T> where
    L: UnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

pub fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

pub fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).

pub fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

pub fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]