Struct mutils::Vec2D [−][src]
Holds the data for a Vec2D.
A Vec2D has a fixed size and cannot be resized.
Implementations
impl<V: Copy> Vec2D<V>
[src]
pub fn new(size: Size<usize>, default: V) -> Self
[src]
Creates a new Vec2D of the size given.
It is filled with the default value.
pub fn new_from_vecs(vec: Vec<Vec<V>>) -> Self
[src]
In Debug mode this will panic! if it is given a vector with different shaped arrays.
pub fn get(&self, pos: Point<usize>) -> Option<&V>
[src]
Returns the tile at the position given.
pub fn set(&mut self, pos: Point<usize>, value: V)
[src]
Sets a tile at the position given.
pub fn rect(&self) -> Rect<usize>
[src]
Returns the size of this Vec2D as a Rect. This is for convenience, as the bottom left corner is always Point(0, 0).
pub fn size(&self) -> Size<usize>
[src]
Returns the size of this Vec2D.
pub fn width(&self) -> usize
[src]
pub fn height(&self) -> usize
[src]
pub fn iter(&self) -> Vec2DIterator<'_, V>ⓘNotable traits for Vec2DIterator<'a, V>
impl<'a, V: Copy> Iterator for Vec2DIterator<'a, V> type Item = (V, Point<usize>);
[src]
Notable traits for Vec2DIterator<'a, V>
impl<'a, V: Copy> Iterator for Vec2DIterator<'a, V> type Item = (V, Point<usize>);
Returns a slice which encompasses the entire map.
pub fn iter_of(&self, area: Rect<usize>) -> Vec2DIterator<'_, V>ⓘNotable traits for Vec2DIterator<'a, V>
impl<'a, V: Copy> Iterator for Vec2DIterator<'a, V> type Item = (V, Point<usize>);
[src]
Notable traits for Vec2DIterator<'a, V>
impl<'a, V: Copy> Iterator for Vec2DIterator<'a, V> type Item = (V, Point<usize>);
Allows you to iterate over a sub section of this map.
pub fn raw_data<'a>(&'a self) -> &'a [V]
[src]
Returns the underlying raw data.
Trait Implementations
impl<V: Clone + Copy> Clone for Vec2D<V>
[src]
impl<V: Copy + Debug> Debug for Vec2D<V>
[src]
impl<V: Copy> Index<Point<usize>> for Vec2D<V>
[src]
impl<V: Copy> IndexMut<Point<usize>> for Vec2D<V>
[src]
impl<'a, V: Copy> IntoIterator for &'a Vec2D<V>
[src]
type Item = (V, Point<usize>)
The type of the elements being iterated over.
type IntoIter = Vec2DIterator<'a, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<V: Copy + PartialEq> PartialEq<Vec2D<V>> for Vec2D<V>
[src]
Auto Trait Implementations
impl<V> RefUnwindSafe for Vec2D<V> where
V: RefUnwindSafe,
[src]
V: RefUnwindSafe,
impl<V> Send for Vec2D<V> where
V: Send,
[src]
V: Send,
impl<V> Sync for Vec2D<V> where
V: Sync,
[src]
V: Sync,
impl<V> Unpin for Vec2D<V> where
V: Unpin,
[src]
V: Unpin,
impl<V> UnwindSafe for Vec2D<V> where
V: UnwindSafe,
[src]
V: 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>,