#[non_exhaustive]pub enum ColumnKind {
Text,
Identifier,
Date,
Number,
Code,
Status,
Actions,
}Expand description
What a column holds.
wiki table-model: the kind is what carries a column’s look, and four of
the reference table’s six rules were per kind rather than per table. A
description states what the column is; each renderer decides what that
looks like in its host, from the facts below rather than from the name.
#[non_exhaustive], Width’s reasoning.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text
Prose. Wraps. What a column is when it says nothing else.
Identifier
A name a machine made: a fingerprint, a hash, a slug. Monospace, and breaks mid-string rather than widening the table.
Date
A point in time. Never wraps, so a date cannot print over its neighbour, and its figures line up down the column.
Number
A quantity. Figures line up and the column aligns to its end, so magnitudes compare by length.
Code
Source text, one row per line. Monospace and never wrapped. A table holding one is read as code, so its rows are not striped or spaced as records.
Status
A state the row is in, drawn as a chip rather than as coloured text.
Actions
The row’s controls. Aligns to its end and shrinks to what it holds.
Implementations§
Source§impl ColumnKind
impl ColumnKind
Sourcepub const fn floor(self) -> u16
pub const fn floor(self) -> u16
The narrowest a column of this kind reads at, in ch, when it declares
nothing narrower.
A date is ten characters in the form every host writes, and a number cut short is a different number, so the kinds that cannot truncate floor at what they hold. Prose and identifiers wrap or break, so theirs is only enough to be recognisable.
Sourcepub const fn holds_minimum(self) -> bool
pub const fn holds_minimum(self) -> bool
Whether a column of this kind keeps its minimum rather than truncating when it is essential and room runs out.
A control, a figure, a date or a state cut short is wrong rather than short. Prose and identifiers end in an ellipsis and stay what they were.
Sourcepub const fn aligns_end(self) -> bool
pub const fn aligns_end(self) -> bool
Whether the column aligns to its end rather than its start.
Trait Implementations§
Source§impl Clone for ColumnKind
impl Clone for ColumnKind
Source§fn clone(&self) -> ColumnKind
fn clone(&self) -> ColumnKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more