[][src]Trait toodee::TooDeeOps

pub trait TooDeeOps<T>: Index<usize, Output = [T]> {
    fn num_cols(&self) -> usize;
fn num_rows(&self) -> usize;
fn bounds(&self) -> (Coordinate, Coordinate);
fn view(&self, start: Coordinate, end: Coordinate) -> TooDeeView<T>;
fn rows(&self) -> Rows<T>;
fn col(&self, col: usize) -> Col<T>; fn size(&self) -> (usize, usize) { ... }
fn is_empty(&self) -> bool { ... }
fn cells(&self) -> Cells<T> { ... } }

Defines operations common to both TooDee and TooDeeView. Default implementations are provided where possible/practical.

Required methods

fn num_cols(&self) -> usize

The number of columns in the area represented by this object.

fn num_rows(&self) -> usize

The number of rows in the area represented by this object.

fn bounds(&self) -> (Coordinate, Coordinate)

Returns the bounds of the object's area within the original TooDee area (views are not nested for now).

fn view(&self, start: Coordinate, end: Coordinate) -> TooDeeView<T>

Returns a view (or subset) of the current area based on the coordinates provided.

fn rows(&self) -> Rows<T>

Returns an iterator of slices, where each slice represents the entire row of the object's area.

fn col(&self, col: usize) -> Col<T>

Returns an iterator over a single column

Loading content...

Provided methods

fn size(&self) -> (usize, usize)

Returns the size/dimensions of the current object.

fn is_empty(&self) -> bool

Returns true if the array contains no elements.

fn cells(&self) -> Cells<T>

Returns an iterator that traverses all cells within the area.

Loading content...

Implementors

impl<'a, T> TooDeeOps<T> for TooDeeView<'a, T>[src]

impl<'a, T> TooDeeOps<T> for TooDeeViewMut<'a, T>[src]

impl<T> TooDeeOps<T> for TooDee<T>[src]

Loading content...