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>ⓘ{ ... } fn view_mut<RS, CS>(Notable traits for SurfaceMutIter<'a, T>
impl<'a, T: 'a> Iterator for SurfaceMutIter<'a, T> type Item = &'a mut T;
&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
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]
Notable traits for SurfaceMutIter<'a, T>
impl<'a, T: 'a> Iterator for SurfaceMutIter<'a, T> type Item = &'a mut T;
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]
&mut self,
rows: RS,
cols: CS
) -> SurfaceMutView<'_, Self::Item> where
RS: ViewBounds,
CS: ViewBounds,
Self: Sized,
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]
Self::Item: Clone,
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]
F: FnMut(usize, usize, Self::Item) -> Self::Item,
Self::Item: Default,
Self: Sized,
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]
Self::Item: Default,
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]
IS: IntoIterator<Item = Self::Item>,
Self: Sized,
Insert items starting with the specified row and column.
Implementations on Foreign Types
impl<'a, S: ?Sized> SurfaceMut for &'a mut S where
S: SurfaceMut,
[src]
impl<'a, S: ?Sized> SurfaceMut for &'a mut S where
S: SurfaceMut,
[src]Implementors
impl<'a, T: 'a> SurfaceMut for SurfaceMutView<'a, T>
[src]
impl<'a, T: 'a> SurfaceMut for SurfaceMutView<'a, T>
[src]impl<S> SurfaceMut for SurfaceOwnedView<S> where
S: SurfaceMut,
[src]
impl<S> SurfaceMut for SurfaceOwnedView<S> where
S: SurfaceMut,
[src]impl<T> SurfaceMut for SurfaceOwned<T>
[src]
impl<T> SurfaceMut for SurfaceOwned<T>
[src]