pub struct Matrix {
pub rows: Vec<Row>,
pub delims: Option<(Delim, Delim)>,
pub kind: MatrixKind,
pub line_spacings: Vec<Option<f64>>,
pub align: Side,
pub columns: Vec<Side>,
pub stack_align: VerticalAlign,
pub cell_align: VerticalAlign,
pub row_lines: Vec<LineStyle>,
pub col_lines: Vec<LineStyle>,
}Expand description
Table of cells with optional delimiters.
Fields§
§rows: Vec<Row>§delims: Option<(Delim, Delim)>§kind: MatrixKind§line_spacings: Vec<Option<f64>>Baseline-to-baseline distance from each row to the one below it, in points. None uses
the style’s line or matrix-row spacing. The vector has one entry per row.
align: SideAlignment applied to every column; per-column rules come from Matrix::columns.
columns: Vec<Side>Optional per-column alignment overriding Matrix::align.
stack_align: VerticalAlignHow the table sits on the line that contains it.
cell_align: VerticalAlignHow a cell’s material sits within its row: top, baseline or bottom.
row_lines: Vec<LineStyle>Style of the line above each row, from the top edge to the bottom edge; row_count + 1
entries.
col_lines: Vec<LineStyle>Style of the line left of each column, from the left edge to the right edge;
col_count + 1 entries.
Implementations§
Source§impl Matrix
impl Matrix
Sourcepub fn empty(rows: usize, cols: usize) -> Self
pub fn empty(rows: usize, cols: usize) -> Self
A matrix of rows rows and cols columns, each cell an empty slot.
Sourcepub fn cell_position(&self, index: usize) -> Option<(usize, usize)>
pub fn cell_position(&self, index: usize) -> Option<(usize, usize)>
Row and column of the cell addressed by a flat slot index, row-major.
Sourcepub fn cell_at(&self, index: usize) -> Option<&Node>
pub fn cell_at(&self, index: usize) -> Option<&Node>
Cell addressed by a flat slot index, row-major.
Sourcepub fn cell_at_mut(&mut self, index: usize) -> Option<&mut Node>
pub fn cell_at_mut(&mut self, index: usize) -> Option<&mut Node>
Mutable cell addressed by a flat slot index, row-major.