[][src]Struct grid_2d::Grid

pub struct Grid<T, C: CoordSystem = XThenY> { /* fields omitted */ }

Methods

impl<T, C: CoordSystem> Grid<T, C>
[src]

pub fn new_fn_with_coord_system<F>(coord_system: C, f: F) -> Self where
    F: FnMut(Coord) -> T, 
[src]

pub fn try_new_iterator<I>(
    coord_system: C,
    iterator: I
) -> Result<Self, IteratorLengthDifferentFromSize> where
    I: Iterator<Item = T>, 
[src]

pub fn new_iterator<I>(coord_system: C, iterator: I) -> Self where
    I: Iterator<Item = T>, 
[src]

pub fn new_grid_map_with_coord<U, F>(grid: Grid<U, C>, f: F) -> Self where
    F: FnMut(Coord, U) -> T, 
[src]

pub fn new_grid_map<U, F>(grid: Grid<U, C>, f: F) -> Self where
    F: FnMut(U) -> T, 
[src]

impl<T: Clone, C: CoordSystem> Grid<T, C>
[src]

pub fn new_clone_with_coord_system(coord_system: C, value: T) -> Self
[src]

impl<T: Default, C: CoordSystem> Grid<T, C>
[src]

pub fn new_default_with_coord_system(coord_system: C) -> Self
[src]

impl<T> Grid<T, XThenY>
[src]

pub fn new_fn<F>(size: Size, f: F) -> Self where
    F: FnMut(Coord) -> T, 
[src]

impl<T: Clone> Grid<T, XThenY>
[src]

pub fn new_clone(size: Size, value: T) -> Self
[src]

impl<T: Default> Grid<T, XThenY>
[src]

pub fn new_default(size: Size) -> Self
[src]

impl<T, C: CoordSystem> Grid<T, C>
[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) -> C::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(&self, coord: Coord) -> Option<usize>
[src]

pub fn get_index(&self, index: usize) -> &T
[src]

pub fn get_index_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, C::CoordIter>
[src]

pub fn enumerate_mut(&mut self) -> GridEnumerateMut<T, C::CoordIter>
[src]

pub fn into_enumerate(self) -> GridIntoEnumerate<T, C::CoordIter>
[src]

Trait Implementations

impl<T: PartialEq, C: PartialEq + CoordSystem> PartialEq<Grid<T, C>> for Grid<T, C>
[src]

impl<T: Eq, C: Eq + CoordSystem> Eq for Grid<T, C>
[src]

impl<T: PartialOrd, C: PartialOrd + CoordSystem> PartialOrd<Grid<T, C>> for Grid<T, C>
[src]

impl<T: Ord, C: Ord + CoordSystem> Ord for Grid<T, C>
[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: Clone, C: Clone + CoordSystem> Clone for Grid<T, C>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T, C: CoordSystem> IntoIterator for Grid<T, C>
[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = GridIntoIter<T>

Which kind of iterator are we turning this into?

impl<T: Debug, C: Debug + CoordSystem> Debug for Grid<T, C>
[src]

impl<T: Hash, C: Hash + CoordSystem> Hash for Grid<T, C>
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T, C: CoordSystem> Index<usize> for Grid<T, C>
[src]

type Output = T

The returned type after indexing.

impl<T, C: CoordSystem> IndexMut<usize> for Grid<T, C>
[src]

Auto Trait Implementations

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]