pub struct Screen { /* private fields */ }
Expand description
A text framebuffer.
Allows you to render things onto it, then can be rendered onto the screen. This strategy avoids flickering, partial renders, etc. and helps deduplicate rendering effort.
Implementations§
source§impl Screen
impl Screen
sourcepub fn cells(&self) -> &[Cell]
pub fn cells(&self) -> &[Cell]
All of the cells of this screen, in row-major order.
i.e. for the screen:
1 2
3 4
this will return &[1, 2, 3, 4]
.
sourcepub fn cells_mut(&mut self) -> &mut [Cell]
pub fn cells_mut(&mut self) -> &mut [Cell]
All of the cells of this screen, in row-major order, mutably.
sourcepub fn rows(&self) -> impl Iterator<Item = &[Cell]>
pub fn rows(&self) -> impl Iterator<Item = &[Cell]>
Returns an iterator over the rows in a screen.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear this screen’s contents, resetting it to the default and filling it with blank cells.
Trait Implementations§
source§impl PartialEq for Screen
impl PartialEq for Screen
impl Eq for Screen
impl StructuralEq for Screen
impl StructuralPartialEq for Screen
Auto Trait Implementations§
impl RefUnwindSafe for Screen
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnwindSafe for Screen
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more