Skip to main content

DataValidationConfig

Struct DataValidationConfig 

Source
pub struct DataValidationConfig {
Show 13 fields pub sqref: String, pub validation_type: ValidationType, pub operator: Option<ValidationOperator>, pub formula1: Option<String>, pub formula2: Option<String>, pub allow_blank: bool, pub error_style: Option<ErrorStyle>, pub error_title: Option<String>, pub error_message: Option<String>, pub prompt_title: Option<String>, pub prompt_message: Option<String>, pub show_input_message: bool, pub show_error_message: bool,
}
Expand description

Configuration for a data validation rule.

Fields§

§sqref: String

The cell range to apply validation to (e.g. “A1:A100”).

§validation_type: ValidationType

The type of validation.

§operator: Option<ValidationOperator>

The comparison operator (not used for list validations).

§formula1: Option<String>

The first formula/value for the validation constraint.

§formula2: Option<String>

The second formula/value (used with Between/NotBetween operators).

§allow_blank: bool

Whether blank cells are allowed.

§error_style: Option<ErrorStyle>

The error display style.

§error_title: Option<String>

The title for the error dialog.

§error_message: Option<String>

The message for the error dialog.

§prompt_title: Option<String>

The title for the input prompt.

§prompt_message: Option<String>

The message for the input prompt.

§show_input_message: bool

Whether to show the input message when the cell is selected.

§show_error_message: bool

Whether to show the error message on invalid input.

Implementations§

Source§

impl DataValidationConfig

Source

pub fn dropdown(sqref: &str, items: &[&str]) -> Self

Create a dropdown list validation.

The items are joined with commas and quoted for the formula. Individual items must not contain commas (Excel limitation).

Source

pub fn whole_number(sqref: &str, min: i64, max: i64) -> Self

Create a whole number range validation (between min and max).

Source

pub fn decimal(sqref: &str, min: f64, max: f64) -> Self

Create a decimal range validation (between min and max).

Source

pub fn text_length( sqref: &str, operator: ValidationOperator, length: u32, ) -> Self

Create a text length validation.

Trait Implementations§

Source§

impl Clone for DataValidationConfig

Source§

fn clone(&self) -> DataValidationConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DataValidationConfig

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.