pub struct Grid<T> { /* private fields */ }Implementations§
Source§impl<T> Grid<T>
impl<T> Grid<T>
pub fn new_fn<F>(size: UCoord, f: F) -> Self
pub fn try_new_iterator<I>(
size: UCoord,
iterator: I,
) -> Result<Self, IteratorLengthDifferentFromUCoord>where
I: Iterator<Item = T>,
pub fn new_iterator<I>(size: UCoord, iterator: I) -> Selfwhere
I: Iterator<Item = T>,
pub fn new_grid_map<U, F>(grid: Grid<U>, f: F) -> Selfwhere
F: FnMut(U) -> T,
pub fn new_grid_map_with_coord<U, F>(grid: Grid<U>, f: F) -> Self
pub fn new_grid_map_ref<U, F>(grid: &Grid<U>, f: F) -> Self
pub fn new_grid_map_ref_with_coord<U, F>(grid: &Grid<U>, f: F) -> Self
Source§impl<T: Clone> Grid<T>
impl<T: Clone> Grid<T>
pub fn new_clone(size: UCoord, value: T) -> Self
pub fn transpose_clone(&self) -> Self
Source§impl<T> Grid<T>
impl<T> Grid<T>
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn size(&self) -> UCoord
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn iter(&self) -> GridIter<'_, T>
pub fn iter_mut(&mut self) -> GridIterMut<'_, T>
pub fn coord_iter(&self) -> ICoordIter
pub fn get(&self, coord: ICoord) -> Option<&T>
pub fn get_mut(&mut self, coord: ICoord) -> Option<&mut T>
pub fn get_tiled(&self, coord: ICoord) -> &T
pub fn get_tiled_mut(&mut self, coord: ICoord) -> &mut T
pub fn index_of_coord_unchecked(&self, coord: ICoord) -> usize
pub fn index_of_coord(&self, coord: ICoord) -> 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: ICoord) -> &T
pub fn get_checked_mut(&mut self, coord: ICoord) -> &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: ICoord, b: ICoord, ) -> Result<(&mut T, &mut T), Get2Error>
pub fn get2_checked_mut(&mut self, a: ICoord, b: ICoord) -> (&mut T, &mut T)
pub fn raw(&self) -> &[T]
pub fn raw_mut(&mut self) -> &mut [T]
pub fn map<U, F: FnMut(T) -> U>(self, f: F) -> Grid<U>
pub fn map_with_coord<U, F: FnMut(ICoord, 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(ICoord, &T) -> U>(&self, f: F) -> Grid<U>
pub fn is_on_edge(&self, coord: ICoord) -> bool
pub fn edge_coord_iter(&self) -> EdgeICoordIter
pub fn edge_iter(&self) -> GridEdgeIter<'_, T> ⓘ
pub fn edge_iter_mut(&mut self) -> GridEdgeIterMut<'_, T> ⓘ
pub fn edge_enumerate(&self) -> GridEdgeEnumerate<'_, T>
pub fn edge_enumerate_mut(&mut self) -> GridEdgeEnumerateMut<'_, T>
Trait Implementations§
Source§impl<T: Ord> Ord for Grid<T>
impl<T: Ord> Ord for Grid<T>
Source§impl<T: PartialOrd> PartialOrd for Grid<T>
impl<T: PartialOrd> PartialOrd for Grid<T>
impl<T: Eq> Eq for Grid<T>
impl<T> StructuralPartialEq for Grid<T>
Auto Trait Implementations§
impl<T> Freeze for Grid<T>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more