pub struct Grid<T, C: CoordSystem = XThenY> { /* private fields */ }
Implementations
sourceimpl<T, C: CoordSystem> Grid<T, C>
impl<T, C: CoordSystem> Grid<T, C>
pub fn new_fn_with_coord_system<F>(coord_system: C, f: F) -> Selfwhere
F: FnMut(Coord) -> T,
sourceimpl<T: Clone, C: CoordSystem> Grid<T, C>
impl<T: Clone, C: CoordSystem> Grid<T, C>
pub fn new_clone_with_coord_system(coord_system: C, value: T) -> Self
sourceimpl<T: Default, C: CoordSystem> Grid<T, C>
impl<T: Default, C: CoordSystem> Grid<T, C>
pub fn new_default_with_coord_system(coord_system: C) -> Self
sourceimpl<T, C: CoordSystem> Grid<T, C>
impl<T, C: CoordSystem> Grid<T, C>
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) -> C::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(&self, coord: Coord) -> Option<usize>
pub fn get_index(&self, index: usize) -> &T
pub fn get_index_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, C::CoordIter>
pub fn enumerate_mut(&mut self) -> GridEnumerateMut<'_, T, C::CoordIter>
Trait Implementations
sourceimpl<T: Ord, C: Ord + CoordSystem> Ord for Grid<T, C>
impl<T: Ord, C: Ord + CoordSystem> Ord for Grid<T, C>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq, C: PartialEq + CoordSystem> PartialEq<Grid<T, C>> for Grid<T, C>
impl<T: PartialEq, C: PartialEq + CoordSystem> PartialEq<Grid<T, C>> for Grid<T, C>
sourceimpl<T: PartialOrd, C: PartialOrd + CoordSystem> PartialOrd<Grid<T, C>> for Grid<T, C>
impl<T: PartialOrd, C: PartialOrd + CoordSystem> PartialOrd<Grid<T, C>> for Grid<T, C>
sourcefn partial_cmp(&self, other: &Grid<T, C>) -> Option<Ordering>
fn partial_cmp(&self, other: &Grid<T, C>) -> Option<Ordering>
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 moreimpl<T: Eq, C: Eq + CoordSystem> Eq for Grid<T, C>
impl<T, C: CoordSystem> StructuralEq for Grid<T, C>
impl<T, C: CoordSystem> StructuralPartialEq for Grid<T, C>
Auto Trait Implementations
impl<T, C> RefUnwindSafe for Grid<T, C>where
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, C> Send for Grid<T, C>where
C: Send,
T: Send,
impl<T, C> Sync for Grid<T, C>where
C: Sync,
T: Sync,
impl<T, C> Unpin for Grid<T, C>where
C: Unpin,
T: Unpin,
impl<T, C> UnwindSafe for Grid<T, C>where
C: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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