[−][src]Struct tuikit::screen::Screen
A Screen is a table of cells to draw on. It's a buffer holding the contents
Implementations
impl Screen
[src]
pub fn new(width: usize, height: usize) -> Self
[src]
create an empty screen with size: (width, height)
pub fn width(&self) -> usize
[src]
get the width of the screen
pub fn height(&self) -> usize
[src]
get the height of the screen
pub fn resize(&mut self, width: usize, height: usize)
[src]
to resize the screen to (width, height)
pub fn present(&mut self) -> Vec<Command>
[src]
sync internal buffer with the terminal
pub fn iter_cell(&self) -> CellIterator<'_>ⓘNotable traits for CellIterator<'a>
impl<'a> Iterator for CellIterator<'a> type Item = (usize, usize, &'a Cell);
[src]
Notable traits for CellIterator<'a>
impl<'a> Iterator for CellIterator<'a> type Item = (usize, usize, &'a Cell);
use tuikit::cell::Cell; use tuikit::canvas::Canvas; use tuikit::screen::Screen; let mut screen = Screen::new(1, 1); screen.put_cell(0, 0, Cell{ ch: 'a', ..Cell::default()}); let mut iter = screen.iter_cell(); assert_eq!(Some((0, 0, &Cell{ ch: 'a', ..Cell::default()})), iter.next()); assert_eq!(None, iter.next());
Trait Implementations
impl Canvas for Screen
[src]
fn size(&self) -> Result<(usize, usize)>
[src]
Get the canvas size (width, height)
fn clear(&mut self) -> Result<()>
[src]
clear the screen buffer
fn put_cell(&mut self, row: usize, col: usize, cell: Cell) -> Result<usize>
[src]
change a cell of position (row, col)
to cell
fn set_cursor(&mut self, row: usize, col: usize) -> Result<()>
[src]
move cursor position (row, col) and show cursor
fn show_cursor(&mut self, show: bool) -> Result<()>
[src]
show/hide cursor, set show
to false
to hide the cursor
fn put_char_with_attr(
&mut self,
row: usize,
col: usize,
ch: char,
attr: Attr
) -> Result<usize>
[src]
&mut self,
row: usize,
col: usize,
ch: char,
attr: Attr
) -> Result<usize>
fn print_with_attr(
&mut self,
row: usize,
col: usize,
content: &str,
attr: Attr
) -> Result<usize>
[src]
&mut self,
row: usize,
col: usize,
content: &str,
attr: Attr
) -> Result<usize>
fn print(&mut self, row: usize, col: usize, content: &str) -> Result<usize>
[src]
impl Debug for Screen
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,