pub struct Buffer { /* private fields */ }Expand description
A rectangular grid of terminal cells.
Stores styled text content for rendering to a terminal. Use
set_string and set_style
to modify the buffer contents.
Implementations§
Source§impl Buffer
impl Buffer
Sourcepub fn scroll_up(&mut self, amount: u16)
pub fn scroll_up(&mut self, amount: u16)
Scrolls content up by the given number of lines.
Lines shifted off the top are discarded; new lines at the bottom are filled with empty cells.
Sourcepub fn scroll_down(&mut self, amount: u16)
pub fn scroll_down(&mut self, amount: u16)
Scrolls content down by the given number of lines.
Lines shifted off the bottom are discarded; new lines at the top are filled with empty cells.
Sourcepub fn get_mut(&mut self, x: u16, y: u16) -> Option<&mut Cell>
pub fn get_mut(&mut self, x: u16, y: u16) -> Option<&mut Cell>
Returns a mutable reference to the cell at the given position.
Sourcepub fn row_remaining_mut(&mut self, x: u16, y: u16) -> Option<&mut [Cell]>
pub fn row_remaining_mut(&mut self, x: u16, y: u16) -> Option<&mut [Cell]>
Returns a mutable slice of cells from position (x, y) to the end of the row.
pub fn set_style(&mut self, area: Rect, style: Style)
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
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