[][src]Struct oxygengine_utils::grid_2d::Grid2d

pub struct Grid2d<T> { /* fields omitted */ }

Implementations

impl<T> Grid2d<T> where
    T: Clone + Send + Sync
[src]

pub fn new(cols: usize, rows: usize, fill: T) -> Self[src]

pub fn with_cells(cols: usize, cells: Vec<T>) -> Self[src]

pub fn resize(&mut self, cols: usize, rows: usize, default: T)[src]

pub fn cols(&self) -> usize[src]

pub fn rows(&self) -> usize[src]

pub fn size(&self) -> (usize, usize)[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

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

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

pub fn cell(&self, col: usize, row: usize) -> Option<&T>[src]

pub fn cell_mut(&mut self, col: usize, row: usize) -> Option<&mut T>[src]

pub fn get(&self, col: usize, row: usize) -> Option<T>[src]

pub fn set(&mut self, col: usize, row: usize, value: T)[src]

pub fn get_col_cells(&self, index: usize) -> Option<Vec<T>>[src]

pub fn get_row_cells(&self, index: usize) -> Option<Vec<T>>[src]

pub fn copy_part(&self, range: Range<(usize, usize)>, result: &mut Self) where
    T: Default
[src]

pub fn get_part(&self, range: Range<(usize, usize)>) -> Self[src]

pub fn get_part_seamless(&self, range: Range<(usize, usize)>) -> Self[src]

pub fn get_view(&self, range: Range<(usize, usize)>) -> Grid2d<&T>[src]

pub fn get_view_seamless(&self, range: Range<(usize, usize)>) -> Grid2d<&T>[src]

pub fn copy_sample(
    &self,
    (col, row): (usize, usize),
    margin: usize,
    result: &mut Self
) where
    T: Default
[src]

pub fn sample(&self, (col, row): (usize, usize), margin: usize) -> Self[src]

pub fn sample_seamless(&self, (col, row): (usize, usize), margin: usize) -> Self[src]

pub fn view_sample(
    &self,
    (col, row): (usize, usize),
    margin: usize
) -> Grid2d<&T>
[src]

pub fn view_sample_seamless(
    &self,
    (col, row): (usize, usize),
    margin: usize
) -> Grid2d<&T>
[src]

pub fn map<F, R>(&self, f: F) -> Grid2d<R> where
    F: FnMut(usize, usize, &T) -> R,
    R: Clone + Send + Sync
[src]

pub fn with<F>(&mut self, f: F) where
    F: FnMut(usize, usize, &T) -> T, 
[src]

pub fn iter(&self) -> impl DoubleEndedIterator<Item = &T>[src]

pub fn iter_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut T>[src]

pub fn iter_view(
    &self,
    range: Range<(usize, usize)>
) -> impl DoubleEndedIterator<Item = (usize, usize, &T)>
[src]

pub fn iter_view_mut(
    &mut self,
    range: Range<(usize, usize)>
) -> impl DoubleEndedIterator<Item = (usize, usize, &mut T)>
[src]

pub fn iter_sample<'a>(
    &'a self,
    range: Range<(usize, usize)>,
    margin: usize
) -> impl DoubleEndedIterator<Item = (usize, usize, Grid2d<&T>)> + 'a
[src]

pub fn neighbor_sample(
    &self,
    (col, row): (usize, usize)
) -> Grid2dNeighborSample<T> where
    T: Default + Copy
[src]

pub fn windows(
    &self,
    (cols, rows): (usize, usize)
) -> impl DoubleEndedIterator<Item = Grid2d<&T>>
[src]

pub fn windows_seamless(
    &self,
    (cols, rows): (usize, usize)
) -> impl DoubleEndedIterator<Item = Grid2d<&T>>
[src]

pub fn into_inner(self) -> (usize, usize, Vec<T>)[src]

pub fn from_view(view: &Grid2d<&T>) -> Self[src]

pub fn get_common_areas(
    first_size: (usize, usize),
    second_size: (usize, usize),
    second_offset: (usize, usize)
) -> Option<Grid2dCommonAreas>
[src]

pub fn access_decoupled<'a>(
    &'a self,
    read: &[(usize, usize)],
    write: &[(usize, usize)],
    reads: &mut [&'a T],
    writes: &mut [&'a mut T]
) -> Result<(), Grid2dError>
[src]

pub unsafe fn access_decoupled_unsafe<'a>(
    &'a self,
    read: &[(usize, usize)],
    write: &[(usize, usize)],
    reads: &mut [&'a T],
    writes: &mut [&'a mut T]
) -> Result<(), Grid2dError>
[src]

impl<T> Grid2d<T> where
    T: Clone + Send + Sync + PartialEq
[src]

pub fn has_union_with(
    &self,
    other: &Self,
    offset_col: usize,
    offset_row: usize
) -> bool
[src]

Trait Implementations

impl<T, '_> Add<&'_ Grid2d<T>> for &'_ Grid2d<T> where
    T: Clone + Send + Sync + Add<Output = T>, 
[src]

type Output = Result<Grid2d<T>, Grid2dError>

The resulting type after applying the + operator.

impl<T: Clone> Clone for Grid2d<T>[src]

impl<T: Debug> Debug for Grid2d<T>[src]

impl<T: Default> Default for Grid2d<T>[src]

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

impl<T, '_> Div<&'_ Grid2d<T>> for &'_ Grid2d<T> where
    T: Clone + Send + Sync + Div<Output = T>, 
[src]

type Output = Result<Grid2d<T>, Grid2dError>

The resulting type after applying the / operator.

impl<I, T> From<(usize, I)> for Grid2d<T> where
    I: Iterator<Item = T>,
    T: Clone + Send + Sync
[src]

impl<T> Index<[usize; 2]> for Grid2d<T> where
    T: Clone + Send + Sync
[src]

type Output = T

The returned type after indexing.

impl<T> Index<(usize, usize)> for Grid2d<T> where
    T: Clone + Send + Sync
[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<[usize; 2]> for Grid2d<T> where
    T: Clone + Send + Sync
[src]

impl<T> IndexMut<(usize, usize)> for Grid2d<T> where
    T: Clone + Send + Sync
[src]

impl<T> Into<(usize, usize, Vec<T>)> for Grid2d<T> where
    T: Clone + Send + Sync
[src]

impl<T> Into<Vec<T>> for Grid2d<T> where
    T: Clone + Send + Sync
[src]

impl<T> IntoIterator for Grid2d<T> where
    T: Clone + Send + Sync
[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T, '_> Mul<&'_ Grid2d<T>> for &'_ Grid2d<T> where
    T: Clone + Send + Sync + Mul<Output = T>, 
[src]

type Output = Result<Grid2d<T>, Grid2dError>

The resulting type after applying the * operator.

impl<T, '_> Neg for &'_ Grid2d<T> where
    T: Clone + Send + Sync + Neg<Output = T>, 
[src]

type Output = Grid2d<T>

The resulting type after applying the - operator.

impl<T> PartialEq<Grid2d<T>> for Grid2d<T> where
    T: PartialEq
[src]

impl<T> Serialize for Grid2d<T> where
    T: Serialize
[src]

impl<T, '_> Sub<&'_ Grid2d<T>> for &'_ Grid2d<T> where
    T: Clone + Send + Sync + Sub<Output = T>, 
[src]

type Output = Result<Grid2d<T>, Grid2dError>

The resulting type after applying the - operator.

Auto Trait Implementations

impl<T> RefUnwindSafe for Grid2d<T> where
    T: RefUnwindSafe

impl<T> Send for Grid2d<T> where
    T: Send

impl<T> Sync for Grid2d<T> where
    T: Sync

impl<T> Unpin for Grid2d<T> where
    T: Unpin

impl<T> UnwindSafe for Grid2d<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.