Trait surf_n_term::surface::Surface [−][src]
pub trait Surface { type Item;}Show methods
fn shape(&self) -> Shape; fn data(&self) -> &[Self::Item]; fn is_empty(&self) -> bool { ... } fn height(&self) -> usize { ... } fn width(&self) -> usize { ... } fn hash(&self) -> u64
where
Self::Item: Hash, { ... } fn get(&self, row: usize, col: usize) -> Option<&Self::Item> { ... } fn iter(&self) -> SurfaceIter<'_, Self::Item>ⓘ{ ... } fn view<RS, CS>(&self, rows: RS, cols: CS) -> SurfaceView<'_, Self::Item>Notable traits for SurfaceIter<'a, T>
impl<'a, T: 'a> Iterator for SurfaceIter<'a, T> type Item = &'a T;
where
RS: ViewBounds,
CS: ViewBounds,
Self: Sized, { ... } fn as_ref(&self) -> SurfaceView<'_, Self::Item> { ... } fn view_owned<RS, CS>(self, rows: RS, cols: CS) -> SurfaceOwnedView<Self>
where
RS: ViewBounds,
CS: ViewBounds,
Self: Sized, { ... } fn transpose(self) -> SurfaceOwnedView<Self>
where
Self: Sized, { ... } fn map<F, T>(&self, f: F) -> SurfaceOwned<T>
where
F: FnMut(usize, usize, &Self::Item) -> T,
Self: Sized, { ... } fn to_owned_surf(&self) -> SurfaceOwned<Self::Item>
where
Self::Item: Clone, { ... }
Matrix like object used to store RGBA
(in case of images) and Cell
(in case of Terminal)
Associated Types
Loading content...Required methods
fn shape(&self) -> Shape
[src]
Shape describes data layout inside Self::data()
slice.
fn data(&self) -> &[Self::Item]
[src]
Slice containing all the items
Note: This slice contains all elements backed by parent object
and elements should be accesed using the offeset calculcated by Shape::offset
Provided methods
fn is_empty(&self) -> bool
[src]
Check if surface is empty
fn height(&self) -> usize
[src]
Height of the surface
fn width(&self) -> usize
[src]
Width of the surface
fn hash(&self) -> u64 where
Self::Item: Hash,
[src]
Self::Item: Hash,
fn get(&self, row: usize, col: usize) -> Option<&Self::Item>
[src]
Get immutable reference to the elemetn specified by row and column
fn iter(&self) -> SurfaceIter<'_, Self::Item>ⓘNotable traits for SurfaceIter<'a, T>
impl<'a, T: 'a> Iterator for SurfaceIter<'a, T> type Item = &'a T;
[src]
Notable traits for SurfaceIter<'a, T>
impl<'a, T: 'a> Iterator for SurfaceIter<'a, T> type Item = &'a T;
Iterator over immutable references to the items of the view in the row-major order
fn view<RS, CS>(&self, rows: RS, cols: CS) -> SurfaceView<'_, Self::Item> where
RS: ViewBounds,
CS: ViewBounds,
Self: Sized,
[src]
RS: ViewBounds,
CS: ViewBounds,
Self: Sized,
Create an immutable sub-surface restricted by rows
and cols
bounds.
fn as_ref(&self) -> SurfaceView<'_, Self::Item>
[src]
fn view_owned<RS, CS>(self, rows: RS, cols: CS) -> SurfaceOwnedView<Self> where
RS: ViewBounds,
CS: ViewBounds,
Self: Sized,
[src]
RS: ViewBounds,
CS: ViewBounds,
Self: Sized,
Create owned sub-surface restricted by rows
and cols
bounds.
fn transpose(self) -> SurfaceOwnedView<Self> where
Self: Sized,
[src]
Self: Sized,
fn map<F, T>(&self, f: F) -> SurfaceOwned<T> where
F: FnMut(usize, usize, &Self::Item) -> T,
Self: Sized,
[src]
F: FnMut(usize, usize, &Self::Item) -> T,
Self: Sized,
fn to_owned_surf(&self) -> SurfaceOwned<Self::Item> where
Self::Item: Clone,
[src]
Self::Item: Clone,
Create owned copy of the surface
Implementations on Foreign Types
Loading content...Implementors
impl<'a, T: 'a> Surface for SurfaceMutView<'a, T>
[src]
impl<'a, T: 'a> Surface for SurfaceMutView<'a, T>
[src]impl<'a, T: 'a> Surface for SurfaceView<'a, T>
[src]
impl<'a, T: 'a> Surface for SurfaceView<'a, T>
[src]impl<S> Surface for SurfaceOwnedView<S> where
S: Surface,
[src]
impl<S> Surface for SurfaceOwnedView<S> where
S: Surface,
[src]