Skip to main content

Column

Struct Column 

Source
pub struct Column {
    pub key: Option<Arc<str>>,
    pub source_key: Option<Arc<str>>,
    pub format: Format,
    pub default: Option<Value>,
    pub datetime_mode: DateTimeMode,
    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>§datetime_mode: DateTimeMode

Rendering 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: bool

Implementations§

Source§

impl Column

Source

pub fn new(key_opt: Option<&str>) -> Self

build new column with an optional key name only

Source

pub fn new_format(fmt: Format, default: Option<Value>) -> Self

build new column data type override and optional default

Source

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.

Source

pub fn from_json(json: &Value) -> Self

build new column data type override and optional default

Source

pub fn set_format(self, fmt: Format) -> Self

Source

pub fn set_default(self, val: Value) -> Self

Source

pub fn set_datetime_mode(self, val: DateTimeMode) -> Self

Source

pub fn set_decimal_comma(self, val: bool) -> Self

Source

pub fn from_key_ref_with_format( key_opt: Option<&str>, format: Format, default: Option<Value>, datetime_mode: DateTimeMode, decimal_comma: bool, ) -> Self

Source

pub fn key_name(&self) -> String

Source

pub fn source_key_name(&self) -> String

Source

pub fn to_json(&self) -> Value

Source

pub fn to_line(&self) -> String

Trait Implementations§

Source§

impl Clone for Column

Source§

fn clone(&self) -> Column

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Column

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.