pub struct TimeValidator {
pub comment: String,
pub max: Timestamp,
pub min: Timestamp,
pub ex_max: bool,
pub ex_min: bool,
pub in_list: Vec<Timestamp>,
pub nin_list: Vec<Timestamp>,
pub query: bool,
pub ord: bool,
}Expand description
Validator for timestamps.
This validator will only pass timestamps. Validation passes if:
- If the
inlist is not empty, the timestamp must be among the timestamp in the list. - The timestamp must not be among the timestamp in the
ninlist. - The timestamp is less than the maximum in
max, or equal to it ifex_maxis not set to true. - The timestamp is greater than the minimum in
min, or equal to it ifex_minis not set to true.
§Defaults
Fields that aren’t specified for the validator use their defaults instead. The defaults for each field are:
- comment: “”
- max: maximum possible timestamp
- min: minimum possible timestamp
- 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: TimestampThe maximum allowed timestamp.
min: TimestampThe minimum allowed timestamp.
ex_max: boolChanges max into an exclusive maximum.
ex_min: boolChanges min into an exclusive maximum.
in_list: Vec<Timestamp>A vector of specific allowed values, stored under the in field. If empty, this vector is not checked against.
nin_list: Vec<Timestamp>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 TimeValidator
impl Clone for TimeValidator
Source§fn clone(&self) -> TimeValidator
fn clone(&self) -> TimeValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimeValidator
impl Debug for TimeValidator
Source§impl Default for TimeValidator
impl Default for TimeValidator
Source§impl<'de> Deserialize<'de> for TimeValidatorwhere
TimeValidator: Default,
impl<'de> Deserialize<'de> for TimeValidatorwhere
TimeValidator: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TimeValidator
impl PartialEq for TimeValidator
Source§impl Serialize for TimeValidator
impl Serialize for TimeValidator
impl StructuralPartialEq for TimeValidator
Auto Trait Implementations§
impl Freeze for TimeValidator
impl RefUnwindSafe for TimeValidator
impl Send for TimeValidator
impl Sync for TimeValidator
impl Unpin for TimeValidator
impl UnwindSafe for TimeValidator
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