Struct vec2d::Vec2D [] [src]

pub struct Vec2D<T> {
    // some fields omitted
}

Container for 2D data

Methods

impl<Elem: Copy> Vec2D<Elem>
[src]

fn from_example(size: Size, example: &Elem) -> Vec2D<Elem>

Create a Vec2D with the given size. All elements are initialized as copies of the example element.

fn from_vec(size: Size, src: Vec<Elem>) -> Option<Vec2D<Elem>>

Create a Vec2D with the given size. The contents are set to src. None is returned if the size does not match the length of src.

fn rect_iter<'a>(&'a self, rect: Rect) -> Option<RectIter<'a, Elem>>

Create an iterator over a rectangular region of the Vec2D. None is returned if the given rect does not fit entirely within the Vec2D.

fn rect_iter_at<'a>(&'a self, rect: Rect, start: Coord) -> Option<RectIter<'a, Elem>>

Create an iterator over a rectangular region of the Vec2D with the start coord. None is returned if the given rect does not fit entirely within the Vec2D or if the start coord is not within rect.

fn rect_iter_mut<'a>(&'a mut self, rect: Rect) -> Option<RectIterMut<'a, Elem>>

Create a mutable iterator over a rectangular region of the Vec2D. None is returned if the given rect does not fit entirely within the Vec2D.

Trait Implementations

impl<T: Debug> Debug for Vec2D<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: Clone> Clone for Vec2D<T>
[src]

fn clone(&self) -> Vec2D<T>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more