pub enum DataValidationKind {
List {
source: String,
},
WholeNumber {
operator: ComparisonOperator,
formula1: String,
formula2: Option<String>,
},
Decimal {
operator: ComparisonOperator,
formula1: String,
formula2: Option<String>,
},
Date {
operator: ComparisonOperator,
formula1: String,
formula2: Option<String>,
},
Time {
operator: ComparisonOperator,
formula1: String,
formula2: Option<String>,
},
TextLength {
operator: ComparisonOperator,
formula1: String,
formula2: Option<String>,
},
Custom {
formula: String,
},
}Expand description
The validation performed by a DataValidationRule.
Variants§
List
type="list": the cell’s value must match one entry from a fixed list — Excel shows a
dropdown. source is written verbatim as formula1, so it can be either a literal
comma-separated list wrapped in quotes (e.g. "\"Yes,No,Maybe\"") or a reference to a range
holding the valid values (e.g. "$D$1:$D$3").
WholeNumber
type="whole": the cell’s value must be a whole number satisfying operator against
formula1 (and formula2, for Between/ NotBetween).
Decimal
type="decimal": like WholeNumber, but the value may have a fractional part.
Date
type="date": the cell’s value must be a date satisfying operator against
formula1/formula2. formula1/formula2 are written verbatim, so the caller is
responsible for passing an Excel date serial number (as text, e.g. "45000") or a
date-returning formula — same “storage, not a conversion helper” posture as everywhere else
formula text is stored in this crate; see crate::ExcelDateTime plus
writer.rs::excel_serial_date if a caller needs to compute one.
Time
type="time": like Date, but for a time-of-day value (a fractional day, e.g. "0.5" for
noon).
TextLength
type="textLength": the cell’s text length must satisfy operator against
formula1/formula2.
Custom
type="custom": an arbitrary formula, evaluated per cell, the value is valid when it
evaluates to TRUE — no operator, unlike every other variant.
Trait Implementations§
Source§impl Clone for DataValidationKind
impl Clone for DataValidationKind
Source§fn clone(&self) -> DataValidationKind
fn clone(&self) -> DataValidationKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more