pub struct Grid {
pub cells: Vec<Vec<Cell>>,
pub width: u16,
pub height: u16,
}Fields§
§cells: Vec<Vec<Cell>>§width: u16§height: u16Implementations§
Source§impl Grid
impl Grid
pub fn new(width: u16, height: u16) -> Self
pub fn get(&self, x: u16, y: u16) -> &Cell
pub fn try_get(&self, x: u16, y: u16) -> Option<&Cell>
pub fn set(&mut self, x: u16, y: u16, cell: Cell)
pub fn write_str(&mut self, x: u16, y: u16, text: &str, style: &CellStyle)
pub fn fill_bg(&mut self, x: u16, y: u16, w: u16, h: u16, color: Color)
pub fn diff(&self, other: &Grid) -> Vec<CellChange>
Sourcepub fn render_to_string(&self) -> String
pub fn render_to_string(&self) -> String
Convert grid to a string representation (for testing/debugging).
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
impl UnwindSafe for Grid
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