Trait surf_n_term::surface::SurfaceMut[][src]

pub trait SurfaceMut: Surface {
    fn data_mut(&mut self) -> &mut [Self::Item];

    fn get_mut(&mut self, row: usize, col: usize) -> Option<&mut Self::Item> { ... }
fn set(&mut self, row: usize, col: usize, item: Self::Item) -> Self::Item { ... }
fn iter_mut(&mut self) -> SurfaceMutIter<'_, Self::Item>

Notable traits for SurfaceMutIter<'a, T>

impl<'a, T: 'a> Iterator for SurfaceMutIter<'a, T> type Item = &'a mut T;
{ ... }
fn view_mut<RS, CS>(
        &mut self,
        rows: RS,
        cols: CS
    ) -> SurfaceMutView<'_, Self::Item>
    where
        RS: ViewBounds,
        CS: ViewBounds,
        Self: Sized
, { ... }
fn as_mut(&mut self) -> SurfaceMutView<'_, Self::Item> { ... }
fn fill(&mut self, item: Self::Item)
    where
        Self::Item: Clone
, { ... }
fn fill_with<F>(&mut self, fill: F)
    where
        F: FnMut(usize, usize, Self::Item) -> Self::Item,
        Self::Item: Default,
        Self: Sized
, { ... }
fn clear(&mut self)
    where
        Self::Item: Default
, { ... }
fn insert<IS>(&mut self, row: usize, col: usize, items: IS)
    where
        IS: IntoIterator<Item = Self::Item>,
        Self: Sized
, { ... } }

Mutable surface

Required methods

fn data_mut(&mut self) -> &mut [Self::Item][src]

Mutable slice containing all the items

Loading content...

Provided methods

fn get_mut(&mut self, row: usize, col: usize) -> Option<&mut Self::Item>[src]

Get mutable reference to the elemetn specified by row and column

fn set(&mut self, row: usize, col: usize, item: Self::Item) -> Self::Item[src]

Set value at row and column

fn iter_mut(&mut self) -> SurfaceMutIter<'_, Self::Item>

Notable traits for SurfaceMutIter<'a, T>

impl<'a, T: 'a> Iterator for SurfaceMutIter<'a, T> type Item = &'a mut T;
[src]

Iterator over mutable references to the items of the view in the row-major order

fn view_mut<RS, CS>(
    &mut self,
    rows: RS,
    cols: CS
) -> SurfaceMutView<'_, Self::Item> where
    RS: ViewBounds,
    CS: ViewBounds,
    Self: Sized
[src]

Create a mutable sub-surface restricted by rows and cols bounds.

fn as_mut(&mut self) -> SurfaceMutView<'_, Self::Item>[src]

fn fill(&mut self, item: Self::Item) where
    Self::Item: Clone
[src]

Fill all elements of the surface with the copy of provided item.

fn fill_with<F>(&mut self, fill: F) where
    F: FnMut(usize, usize, Self::Item) -> Self::Item,
    Self::Item: Default,
    Self: Sized
[src]

Fill all the elments of the surface by colling af function.

Function is called it row, column and the current item value as its arguments.

fn clear(&mut self) where
    Self::Item: Default
[src]

Fill all the element of the surface with default value.

fn insert<IS>(&mut self, row: usize, col: usize, items: IS) where
    IS: IntoIterator<Item = Self::Item>,
    Self: Sized
[src]

Insert items starting with the specified row and column.

Loading content...

Implementations on Foreign Types

impl<'a, S: ?Sized> SurfaceMut for &'a mut S where
    S: SurfaceMut
[src]

fn data_mut(&mut self) -> &mut [Self::Item][src]

Loading content...

Implementors

impl<'a, T: 'a> SurfaceMut for SurfaceMutView<'a, T>[src]

fn data_mut(&mut self) -> &mut [Self::Item][src]

impl<S> SurfaceMut for SurfaceOwnedView<S> where
    S: SurfaceMut
[src]

fn data_mut(&mut self) -> &mut [Self::Item][src]

impl<T> SurfaceMut for SurfaceOwned<T>[src]

fn data_mut(&mut self) -> &mut [Self::Item][src]

Loading content...