pub struct Grid<T> { /* private fields */ }
Implementations
sourceimpl<T> Grid<T>
impl<T> Grid<T>
pub fn new_fn<F>(size: Size, f: F) -> Self where
F: FnMut(Coord) -> T,
pub fn try_new_iterator<I>(
size: Size,
iterator: I
) -> Result<Self, IteratorLengthDifferentFromSize> where
I: Iterator<Item = T>,
pub fn new_iterator<I>(size: Size, iterator: I) -> Self where
I: Iterator<Item = T>,
pub fn new_grid_map<U, F>(grid: Grid<U>, f: F) -> Self where
F: FnMut(U) -> T,
pub fn new_grid_map_with_coord<U, F>(grid: Grid<U>, f: F) -> Self where
F: FnMut(Coord, U) -> T,
pub fn new_grid_map_ref<U, F>(grid: &Grid<U>, f: F) -> Self where
F: FnMut(&U) -> T,
pub fn new_grid_map_ref_with_coord<U, F>(grid: &Grid<U>, f: F) -> Self where
F: FnMut(Coord, &U) -> T,
sourceimpl<T: Clone> Grid<T>
impl<T: Clone> Grid<T>
pub fn new_clone(size: Size, value: T) -> Self
pub fn transpose_clone(&self) -> Self
sourceimpl<T> Grid<T>
impl<T> Grid<T>
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn size(&self) -> Size
pub fn len(&self) -> usize
pub fn iter(&self) -> GridIter<'_, T>
pub fn iter_mut(&mut self) -> GridIterMut<'_, T>
pub fn coord_iter(&self) -> CoordIter
pub fn get(&self, coord: Coord) -> Option<&T>
pub fn get_mut(&mut self, coord: Coord) -> Option<&mut T>
pub fn get_tiled(&self, coord: Coord) -> &T
pub fn get_tiled_mut(&mut self, coord: Coord) -> &mut T
pub fn index_of_coord_unchecked(&self, coord: Coord) -> usize
pub fn index_of_coord(&self, coord: Coord) -> Option<usize>
pub fn get_index_checked(&self, index: usize) -> &T
pub fn get_index_checked_mut(&mut self, index: usize) -> &mut T
pub fn get_checked(&self, coord: Coord) -> &T
pub fn get_checked_mut(&mut self, coord: Coord) -> &mut T
pub fn enumerate(&self) -> GridEnumerate<'_, T>
pub fn enumerate_mut(&mut self) -> GridEnumerateMut<'_, T>
pub fn into_enumerate(self) -> GridIntoEnumerate<T>
pub fn rows(&self) -> GridRows<'_, T>
pub fn rows_mut(&mut self) -> GridRowsMut<'_, T>
pub fn get2_mut(
&mut self,
a: Coord,
b: Coord
) -> Result<(&mut T, &mut T), Get2Error>
pub fn get2_checked_mut(&mut self, a: Coord, b: Coord) -> (&mut T, &mut T)
pub fn raw(&self) -> &[T]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn raw_mut(&mut self) -> &mut [T]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn map<U, F: FnMut(T) -> U>(self, f: F) -> Grid<U>
pub fn map_with_coord<U, F: FnMut(Coord, T) -> U>(self, f: F) -> Grid<U>
pub fn map_ref<U, F: FnMut(&T) -> U>(&self, f: F) -> Grid<U>
pub fn map_ref_with_coord<U, F: FnMut(Coord, &T) -> U>(&self, f: F) -> Grid<U>
Trait Implementations
sourceimpl<T: Ord> Ord for Grid<T>
impl<T: Ord> Ord for Grid<T>
sourceimpl<T: PartialOrd> PartialOrd<Grid<T>> for Grid<T>
impl<T: PartialOrd> PartialOrd<Grid<T>> for Grid<T>
sourcefn partial_cmp(&self, other: &Grid<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Grid<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T: Eq> Eq for Grid<T>
impl<T> StructuralEq for Grid<T>
impl<T> StructuralPartialEq for Grid<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Grid<T> where
T: RefUnwindSafe,
impl<T> Send for Grid<T> where
T: Send,
impl<T> Sync for Grid<T> where
T: Sync,
impl<T> Unpin for Grid<T> where
T: Unpin,
impl<T> UnwindSafe for Grid<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more