pub struct TerminalBuffer { /* private fields */ }Expand description
A 2D grid of terminal cells with cursor tracking.
Implementations§
Source§impl TerminalBuffer
impl TerminalBuffer
pub fn new(rows: usize, cols: usize) -> Self
pub fn rows(&self) -> usize
pub fn cols(&self) -> usize
pub fn cursor_row(&self) -> usize
pub fn cursor_col(&self) -> usize
pub fn cursor_visible(&self) -> bool
pub fn cells(&self) -> &Vec<Vec<Cell>>
pub fn get_cell(&self, row: usize, col: usize) -> Option<&Cell>
pub fn set_cell(&mut self, row: usize, col: usize, cell: Cell)
pub fn write_char(&mut self, ch: char)
pub fn move_cursor(&mut self, row: usize, col: usize)
pub fn move_cursor_relative(&mut self, row_delta: isize, col_delta: isize)
pub fn set_cursor_visible(&mut self, visible: bool)
pub fn clear_screen(&mut self)
pub fn clear_line(&mut self, row: usize)
pub fn clear_line_from_cursor(&mut self)
pub fn clear_line_to_cursor(&mut self)
pub fn scroll_up(&mut self)
pub fn carriage_return(&mut self)
pub fn newline(&mut self)
pub fn tab(&mut self)
pub fn backspace(&mut self)
pub fn set_sgr( &mut self, fg: Color, bg: Color, bold: bool, italic: bool, underline: bool, dim: bool, )
pub fn reset_sgr(&mut self)
Trait Implementations§
Source§impl Clone for TerminalBuffer
impl Clone for TerminalBuffer
Source§fn clone(&self) -> TerminalBuffer
fn clone(&self) -> TerminalBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TerminalBuffer
impl RefUnwindSafe for TerminalBuffer
impl Send for TerminalBuffer
impl Sync for TerminalBuffer
impl Unpin for TerminalBuffer
impl UnwindSafe for TerminalBuffer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.