table::display
On this page
- Constants
- Implementations
impl Table2
Text forms of a table: the aligned preview Display prints (rows
and columns cut in the middle past a limit) and GitHub-flavoured
Markdown.
Constants
MAX_ROWSSource
pub const MAX_ROWS: usize = 10Rows Display shows before cutting (half from each end).
MAX_COLSSource
pub const MAX_COLS: usize = 8Columns Display shows before cutting.
MAX_WIDTHSource
pub const MAX_WIDTH: usize = 24Code points of a cell before it is cut with ....
Implementations
impl Table
The preview with at most
max_rowsrows andmax_colscolumns (the middle cut, marked...), the shape on the first line and each column's type under its name.nabilet t = table::table!{ "a": [1, 2, 3], "b": ["x", "y", "z"] }; let s = t.preview(2, 8); assert(s.starts_with("shape: (3, 2)")); assert(s.contains("..."));The whole table as a GitHub-flavoured Markdown table: numbers right-aligned,
|in a cell escaped, null as an empty cell.nabilet t = table::table!{ "name": ["a|b"], "n": [1] }; assert(t.to_markdown() == "| name | n |\n| :--- | ---: |\n| a\\|b | 1 |\n");