pub struct Column {
pub key: Option<KeySegment>,
pub source_key: Option<Arc<str>>,
pub format: Format,
pub default: Option<Value>,
pub datetime_mode: DateTimeMode,
pub decimal_comma: bool,
}Fields§
§key: Option<KeySegment>Where a matched cell’s value lands in the output row. Some(KeySegment::Simple(_))
is a plain rename, functionally identical to the old Option<Arc<str>> this field
used to be; the other variants describe nested/grouped placement – see
key_segment.rs.
source_key: Option<Arc<str>>Natural (auto-detected, snake_cased) key to match this override against, regardless of the column’s actual position. When None, the column applies positionally instead (matched by its index within the configured column list), as before.
format: Format§default: Option<Value>§datetime_mode: DateTimeModeRendering mode applied only when this column’s own format is Format::Auto and
the source cell is already a genuine datetime (Data::DateTime/Data::DateTimeIso)
– it has no effect on strings or numbers in that column, unlike
Format::Date/Format::Time/Format::Hm/Format::DateTime, which force any
cell type through date/time interpretation. Overrides the row-wide
RowOptionSet::datetime_mode default when set to anything other than Full.
decimal_comma: boolImplementations§
Source§impl Column
impl Column
Sourcepub fn new_format(fmt: Format, default: Option<Value>) -> Self
pub fn new_format(fmt: Format, default: Option<Value>) -> Self
build new column data type override and optional default
Sourcepub fn from_source_key_with_format(
source_key: &str,
key_opt: Option<&str>,
format: Format,
default: Option<Value>,
datetime_mode: DateTimeMode,
decimal_comma: bool,
) -> Self
pub fn from_source_key_with_format( source_key: &str, key_opt: Option<&str>, format: Format, default: Option<Value>, datetime_mode: DateTimeMode, decimal_comma: bool, ) -> Self
build a column override matched by its natural (auto-detected) key rather than by position, e.g. to rename and/or reformat a single field out of many without needing to enumerate every column ahead of it.
Sourcepub fn from_json(json: &Value) -> Self
pub fn from_json(json: &Value) -> Self
build new column data type override and optional default
pub fn set_format(self, fmt: Format) -> Self
pub fn set_default(self, val: Value) -> Self
pub fn set_datetime_mode(self, val: DateTimeMode) -> Self
pub fn set_decimal_comma(self, val: bool) -> Self
pub fn from_key_ref_with_format( key_opt: Option<&str>, format: Format, default: Option<Value>, datetime_mode: DateTimeMode, decimal_comma: bool, ) -> Self
Sourcepub fn key_name(&self) -> String
pub fn key_name(&self) -> String
A flat, single-string fallback for contexts that only show one name per column
(header/metadata listings) – for a plain rename (KeySegment::Simple) this is
the whole story; for a nested key, see KeySegment’s own Display impl for what
this collapses to.