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

Implementations§

source§

impl<T> Grid2d<T>where T: Clone + Send + Sync,

source

pub fn new(cols: usize, rows: usize, fill: T) -> Grid2d<T>

source

pub fn with_cells(cols: usize, cells: Vec<T, Global>) -> Grid2d<T>

source

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

source

pub fn cols(&self) -> usize

source

pub fn rows(&self) -> usize

source

pub fn size(&self) -> (usize, usize)

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn copy_part(&self, range: Range<(usize, usize)>, result: &mut Grid2d<T>)where T: Default,

source

pub fn get_part(&self, range: Range<(usize, usize)>) -> Grid2d<T>

source

pub fn get_part_seamless(&self, range: Range<(usize, usize)>) -> Grid2d<T>

source

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

source

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

source

pub fn copy_sample( &self, _: (usize, usize), margin: usize, result: &mut Grid2d<T> )where T: Default,

source

pub fn sample(&self, _: (usize, usize), margin: usize) -> Grid2d<T>

source

pub fn sample_seamless(&self, _: (usize, usize), margin: usize) -> Grid2d<T>

source

pub fn view_sample(&self, _: (usize, usize), margin: usize) -> Grid2d<&T>

source

pub fn view_sample_seamless( &self, _: (usize, usize), margin: usize ) -> Grid2d<&T>

source

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

source

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

source

pub fn iter(&self) -> impl DoubleEndedIterator

source

pub fn iter_mut(&mut self) -> impl DoubleEndedIterator

source

pub fn iter_view( &self, range: Range<(usize, usize)> ) -> impl DoubleEndedIterator

source

pub fn iter_view_mut( &mut self, range: Range<(usize, usize)> ) -> impl DoubleEndedIterator

source

pub fn iter_sample( &self, range: Range<(usize, usize)>, margin: usize ) -> impl DoubleEndedIterator

source

pub fn neighbor_sample(&self, _: (usize, usize)) -> Grid2dNeighborSample<T>where T: Default + Copy,

source

pub fn windows(&self, _: (usize, usize)) -> impl DoubleEndedIterator

source

pub fn windows_seamless(&self, _: (usize, usize)) -> impl DoubleEndedIterator

source

pub fn into_inner(self) -> (usize, usize, Vec<T, Global>)

source

pub fn from_view(view: &Grid2d<&T>) -> Grid2d<T>

source

pub fn get_common_areas( first_size: (usize, usize), second_size: (usize, usize), second_offset: (usize, usize) ) -> Option<(Range<(usize, usize)>, Range<(usize, usize)>)>

source

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

source

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>

source§

impl<T> Grid2d<T>where T: Clone + Send + Sync + PartialEq<T>,

source

pub fn has_union_with( &self, other: &Grid2d<T>, offset_col: usize, offset_row: usize ) -> bool

Trait Implementations§

source§

impl<T> Add<&Grid2d<T>> for &Grid2d<T>where T: Clone + Send + Sync + Add<T, Output = T>,

§

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

The resulting type after applying the + operator.
source§

fn add(self, other: &Grid2d<T>) -> <&Grid2d<T> as Add<&Grid2d<T>>>::Output

Performs the + operation. Read more
source§

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

source§

fn clone(&self) -> Grid2d<T>

Returns a copy 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 for Grid2d<T>where T: Debug,

source§

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

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

impl<T> Default for Grid2d<T>where T: Default,

source§

fn default() -> Grid2d<T>

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

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

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Grid2d<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Div<&Grid2d<T>> for &Grid2d<T>where T: Clone + Send + Sync + Div<T, Output = T>,

§

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

The resulting type after applying the / operator.
source§

fn div(self, other: &Grid2d<T>) -> <&Grid2d<T> as Div<&Grid2d<T>>>::Output

Performs the / operation. Read more
source§

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

source§

fn from(_: (usize, I)) -> Grid2d<T>

Converts to this type from the input type.
source§

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

§

type Output = T

The returned type after indexing.
source§

fn index(&self, _: [usize; 2]) -> &T

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

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

§

type Output = T

The returned type after indexing.
source§

fn index(&self, _: (usize, usize)) -> &T

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

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

source§

fn index_mut(&mut self, _: [usize; 2]) -> &mut T

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

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

source§

fn index_mut(&mut self, _: (usize, usize)) -> &mut T

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

impl<T> IntoIterator for Grid2d<T>where T: Clone + Send + Sync,

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, Global>

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

fn into_iter(self) -> <Grid2d<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> Mul<&Grid2d<T>> for &Grid2d<T>where T: Clone + Send + Sync + Mul<T, Output = T>,

§

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

The resulting type after applying the * operator.
source§

fn mul(self, other: &Grid2d<T>) -> <&Grid2d<T> as Mul<&Grid2d<T>>>::Output

Performs the * operation. Read more
source§

impl<T> Neg for &Grid2d<T>where T: Clone + Send + Sync + Neg<Output = T>,

§

type Output = Grid2d<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> <&Grid2d<T> as Neg>::Output

Performs the unary - operation. Read more
source§

impl<T> PartialEq<Grid2d<T>> for Grid2d<T>where T: PartialEq<T>,

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Serialize for Grid2d<T>where T: Serialize,

source§

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

Serialize this value into the given Serde serializer. Read more
source§

impl<T> Sub<&Grid2d<T>> for &Grid2d<T>where T: Clone + Send + Sync + Sub<T, Output = T>,

§

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

The resulting type after applying the - operator.
source§

fn sub(self, other: &Grid2d<T>) -> <&Grid2d<T> as Sub<&Grid2d<T>>>::Output

Performs the - operation. Read more

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,