pub enum Rule {
Show 13 variants
Contains {
field: String,
value: String,
case_sensitive: bool,
},
LengthGte {
field: String,
min: usize,
},
LengthLte {
field: String,
max: usize,
},
Matches {
field: String,
pattern: String,
},
Equals {
field: String,
value: Value,
},
NotEquals {
field: String,
value: Value,
},
GreaterThan {
field: String,
value: f64,
},
LessThan {
field: String,
value: f64,
},
Exists {
field: String,
},
NotExists {
field: String,
},
All {
rules: Vec<Rule>,
},
Any {
rules: Vec<Rule>,
},
Not {
rule: Box<Rule>,
},
}Expand description
验证规则
Variants§
Contains
包含检查
LengthGte
长度大于等于
LengthLte
长度小于等于
Matches
正则匹配
Equals
相等
NotEquals
不相等
GreaterThan
大于
LessThan
小于
Exists
存在
NotExists
不存在
All
组合规则:全部满足
Any
组合规则:任一满足
Not
取反
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
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
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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