pub struct RenderGrid {
pub cells: Vec<Vec<Cell>>,
pub width: u32,
pub height: u32,
}Expand description
A 2D grid of Cells with explicit width × height dimensions.
Filters operate on owned RenderGrids and return new owned grids per
AD-002 (immutable transformations). Construction normalizes ragged
row vectors to a rectangular shape padded with Cell::blank so
downstream filters can assume cells[y].len() == width for every
row.
Allocated as Vec<Vec<Cell>> rather than a single flat Vec<Cell>
because the filter implementations (transpose, rotate, flip) work
row-major and benefit from being able to .swap(), .reverse(), and
.collect() per-row without index arithmetic.
Fields§
§cells: Vec<Vec<Cell>>Cells in row-major order. cells[y][x] is the cell at column x,
row y. Every row is exactly width cells long after construction.
width: u32Number of columns.
height: u32Number of rows.
Implementations§
Source§impl RenderGrid
impl RenderGrid
Sourcepub fn blank(width: u32, height: u32) -> Self
pub fn blank(width: u32, height: u32) -> Self
Construct a rectangular grid sized width × height, filled
with blank cells.
Sourcepub fn from_rows(rows: Vec<Vec<Cell>>) -> Self
pub fn from_rows(rows: Vec<Vec<Cell>>) -> Self
Build a grid from a vector of rows; ragged rows are padded with
Cell::blank up to the longest row’s length.
Sourcepub fn from_text_rows(rows: &[String]) -> Self
pub fn from_text_rows(rows: &[String]) -> Self
Construct a grid from a multi-line &str. Each line is one row;
each character is one cell with default color. Convenient for
tests and the FLF/TLF render pipeline’s Vec<String> row output.
Trait Implementations§
Source§impl Clone for RenderGrid
impl Clone for RenderGrid
Source§fn clone(&self) -> RenderGrid
fn clone(&self) -> RenderGrid
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderGrid
impl Debug for RenderGrid
Source§impl PartialEq for RenderGrid
impl PartialEq for RenderGrid
Source§fn eq(&self, other: &RenderGrid) -> bool
fn eq(&self, other: &RenderGrid) -> bool
self and other values to be equal, and is used by ==.