Enum Column
pub enum Column {
Text(Vec<String>),
Number(Vec<f64>),
Date(Vec<Option<NaiveDate>>),
}Expand description
One column of a record set: a name, and values of one type down the column.
The shape a dataframe wants — parallel columns rather than a row per record — because that is what crosses the language boundary without a per-row object, and what a caller pivots from.
Variants§
Text(Vec<String>)
Text: a label, a curve name, an input’s spelling.
Number(Vec<f64>)
Numbers.
Date(Vec<Option<NaiveDate>>)
Dates, absent where the row has none.
Implementations§
§impl Column
impl Column
pub fn text(&self) -> Option<&[String]>
pub fn text(&self) -> Option<&[String]>
The text column’s values, or None for a column of another kind.
pub fn numbers(&self) -> Option<&[f64]>
pub fn numbers(&self) -> Option<&[f64]>
The numeric column’s values, or None for a column of another kind.
pub fn dates(&self) -> Option<&[Option<NaiveDate>]>
pub fn dates(&self) -> Option<&[Option<NaiveDate>]>
The date column’s values, or None for a column of another kind.
pub fn render_cells(&self) -> (Vec<String>, bool)
pub fn render_cells(&self) -> (Vec<String>, bool)
Every cell as text, and whether the column sits right: text and dates
left, numbers right with thousands separators at two decimals where the
column’s largest finite magnitude is at least a thousand and six
otherwise, so money reads as money and a rate keeps its digits. The
cells Display prints, exposed so another rendering shows the same
figures.