pub struct F64Validator {
pub comment: String,
pub max: f64,
pub min: f64,
pub ex_max: bool,
pub ex_min: bool,
pub in_list: Vec<f64>,
pub nin_list: Vec<f64>,
pub query: bool,
pub ord: bool,
}Expand description
Validator for 64-bit floating-point values.
This validator will only pass f64 values. Validation passes if:
- If
maxis a number, that the value is less than the maximum inmax, or equal to it ifex_maxis not set to true. - If
minis a number, that the value is greater than the minimum inmin, or equal to it ifex_minis not set to true. - If the
inlist is not empty, the value must be among the values in it. This performs an exact bit-wise match. - The value must not be among the values in the
ninlist. This performas an exact bit-wise match.
§Defaults
Fields that aren’t specified for the validator use their defaults instead. The defaults for each field are:
- comment: “”
- max: NaN
- min: NaN
- ex_max: false
- ex_min: false
- in_list: empty
- nin_list: empty
- query: false
- ord: false
Fields§
§comment: StringAn optional comment explaining the validator.
max: f64The maximum allowed f64 value. If NaN, it is ignored.
min: f64The minimum allowed f64 value. If NaN, it is ignored.
ex_max: boolChanges max into an exclusive maximum.
ex_min: boolChanges min into an exclusive maximum.
in_list: Vec<f64>A vector of specific allowed values, stored under the in field. If empty, this vector is not checked against.
nin_list: Vec<f64>A vector of specific unallowed values, stored under the nin field.
query: boolIf true, queries against matching spots may have values in the in or nin lists.
ord: boolIf true, queries against matching spots may set the max, min, ex_max, and ex_min
values to non-defaults.
Implementations§
Trait Implementations§
Source§impl Clone for F64Validator
impl Clone for F64Validator
Source§fn clone(&self) -> F64Validator
fn clone(&self) -> F64Validator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more