Struct grid_2d::Grid [−][src]
Implementations
impl<T> Grid<T>
[src]
pub fn new_fn<F>(size: Size, f: F) -> Self where
F: FnMut(Coord) -> T,
[src]
F: FnMut(Coord) -> T,
pub fn try_new_iterator<I>(
size: Size,
iterator: I
) -> Result<Self, IteratorLengthDifferentFromSize> where
I: Iterator<Item = T>,
[src]
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>,
[src]
I: Iterator<Item = T>,
pub fn new_grid_map<U, F>(grid: Grid<U>, f: F) -> Self where
F: FnMut(U) -> T,
[src]
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,
[src]
F: FnMut(Coord, U) -> T,
pub fn new_grid_map_ref<U, F>(grid: &Grid<U>, f: F) -> Self where
F: FnMut(&U) -> T,
[src]
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,
[src]
F: FnMut(Coord, &U) -> T,
impl<T: Clone> Grid<T>
[src]
impl<T: Copy> Grid<T>
[src]
impl<T: Default> Grid<T>
[src]
pub fn new_default(size: Size) -> Self
[src]
impl<T> Grid<T>
[src]
pub fn width(&self) -> u32
[src]
pub fn height(&self) -> u32
[src]
pub fn size(&self) -> Size
[src]
pub fn len(&self) -> usize
[src]
pub fn iter(&self) -> GridIter<'_, T>
[src]
pub fn iter_mut(&mut self) -> GridIterMut<'_, T>
[src]
pub fn coord_iter(&self) -> CoordIter
[src]
pub fn get(&self, coord: Coord) -> Option<&T>
[src]
pub fn get_mut(&mut self, coord: Coord) -> Option<&mut T>
[src]
pub fn get_tiled(&self, coord: Coord) -> &T
[src]
pub fn get_tiled_mut(&mut self, coord: Coord) -> &mut T
[src]
pub fn index_of_coord_unchecked(&self, coord: Coord) -> usize
[src]
pub fn index_of_coord(&self, coord: Coord) -> Option<usize>
[src]
pub fn get_index_checked(&self, index: usize) -> &T
[src]
pub fn get_index_checked_mut(&mut self, index: usize) -> &mut T
[src]
pub fn get_checked(&self, coord: Coord) -> &T
[src]
pub fn get_checked_mut(&mut self, coord: Coord) -> &mut T
[src]
pub fn enumerate(&self) -> GridEnumerate<'_, T>
[src]
pub fn enumerate_mut(&mut self) -> GridEnumerateMut<'_, T>
[src]
pub fn into_enumerate(self) -> GridIntoEnumerate<T>
[src]
pub fn rows(&self) -> GridRows<'_, T>
[src]
pub fn rows_mut(&mut self) -> GridRowsMut<'_, T>
[src]
pub fn get2_mut(
&mut self,
a: Coord,
b: Coord
) -> Result<(&mut T, &mut T), Get2Error>
[src]
&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)
[src]
pub fn raw(&self) -> &[T]
[src]
pub fn raw_mut(&mut self) -> &mut [T]
[src]
pub fn map<U, F: FnMut(T) -> U>(self, f: F) -> Grid<U>
[src]
pub fn map_with_coord<U, F: FnMut(Coord, T) -> U>(self, f: F) -> Grid<U>
[src]
pub fn map_ref<U, F: FnMut(&T) -> U>(&self, f: F) -> Grid<U>
[src]
pub fn map_ref_with_coord<U, F: FnMut(Coord, &T) -> U>(&self, f: F) -> Grid<U>
[src]
Trait Implementations
impl<T: Clone> Clone for Grid<T>
[src]
impl<T: Debug> Debug for Grid<T>
[src]
impl<T: Eq> Eq for Grid<T>
[src]
impl<T: Hash> Hash for Grid<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Ord> Ord for Grid<T>
[src]
fn cmp(&self, other: &Grid<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: PartialEq> PartialEq<Grid<T>> for Grid<T>
[src]
impl<T: PartialOrd> PartialOrd<Grid<T>> for Grid<T>
[src]
fn partial_cmp(&self, other: &Grid<T>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> StructuralEq for Grid<T>
[src]
impl<T> StructuralPartialEq for Grid<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Grid<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Grid<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Grid<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Grid<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Grid<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,