[][src]Struct gridly::grid::View

pub struct View<'a, G: Grid + ?Sized, T: LocComponent> { /* fields omitted */ }

A view of the Rows or Columns in a grid.

This struct provides a row- or column-major view of a grid. For instance, a View<MyGrid, Row> is a View of all of the rows in MyGrid.

A view can be indexed over its major ordering. For example, a View<G, Row> can be indexed over rows,

Methods

impl<'a, G: Grid + ?Sized, T: LocComponent> View<'a, G, T>[src]

pub unsafe fn get_unchecked(&self, index: T) -> SingleView<'a, G, T>[src]

Get a view of a single row or column of the grid, without bounds checking the index.

pub fn get(&self, index: T) -> Result<SingleView<'a, G, T>, RangeError<T>>[src]

Get a view of a single row or column of the grid. Returns a range error if the index is out of range.

Important traits for ComponentRange<C>
pub fn range(&self) -> ComponentRange<T>[src]

Get a range over all the row or column indexes of this view.

pub fn iter(
    &self
) -> impl Iterator<Item = SingleView<'a, G, T>> + DoubleEndedIterator + FusedIterator + ExactSizeIterator + Debug + Clone
[src]

Create an iterator over the rows or columns of the grid. Each iterated element is a SingleView, which is a view over a single row or column of the grid.

Auto Trait Implementations

impl<'a, G: ?Sized, T> Send for View<'a, G, T> where
    G: Sync,
    T: Send

impl<'a, G: ?Sized, T> Unpin for View<'a, G, T> where
    T: Unpin

impl<'a, G: ?Sized, T> Sync for View<'a, G, T> where
    G: Sync,
    T: Sync

impl<'a, G: ?Sized, T> UnwindSafe for View<'a, G, T> where
    G: RefUnwindSafe,
    T: UnwindSafe

impl<'a, G: ?Sized, T> RefUnwindSafe for View<'a, G, T> where
    G: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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