pub struct Column {
pub key: Option<Arc<str>>,
pub source_key: Option<Arc<str>>,
pub format: Format,
pub default: Option<Value>,
pub date_only: bool,
pub decimal_comma: bool,
}Fields§
§key: Option<Arc<str>>§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>§date_only: bool§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>,
date_only: bool,
decimal_comma: bool,
) -> Self
pub fn from_source_key_with_format( source_key: &str, key_opt: Option<&str>, format: Format, default: Option<Value>, date_only: bool, 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_date_only(self, val: bool) -> 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>, date_only: bool, decimal_comma: bool, ) -> Self
pub fn key_name(&self) -> String
pub fn source_key_name(&self) -> String
pub fn to_json(&self) -> Value
pub fn to_line(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more