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]
impl<L, T> CellMap<L, T> where
L: Layer,
[src]pub fn num_cells(&self) -> Vector2<usize>
[src]
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]
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]
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]
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]
impl<L, T> CellMap<L, T> where
L: Layer,
T: Clone,
[src]pub fn new_from_elem(params: CellMapParams, elem: T) -> Self
[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
.
impl<L, T> CellMap<L, T> where
L: Layer,
T: Default + Clone,
[src]
impl<L, T> CellMap<L, T> where
L: Layer,
T: Default + Clone,
[src]pub fn new(params: CellMapParams) -> Self
[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<'de, L, T> Deserialize<'de> for CellMap<L, T> where
L: Layer,
T: Deserialize<'de>,
[src]
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<L, T> RefUnwindSafe for CellMap<L, T> where
L: RefUnwindSafe,
T: RefUnwindSafe,
L: RefUnwindSafe,
T: RefUnwindSafe,
impl<L, T> Send for CellMap<L, T> where
L: Send,
T: Send,
L: Send,
T: Send,
impl<L, T> Sync for CellMap<L, T> where
L: Sync,
T: Sync,
L: Sync,
T: Sync,
impl<L, T> Unpin for CellMap<L, T> where
L: Unpin,
L: Unpin,
impl<L, T> UnwindSafe for CellMap<L, T> where
L: UnwindSafe,
T: RefUnwindSafe,
L: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
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
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
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
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]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,