pub enum Rule {
Max(i64),
Min(i64),
Format(&'static str),
Lambda(Box<dyn Fn(FieldValue) -> bool>, Option<Box<dyn Fn(&str, &str, &str) -> String>>),
}Expand description
This enum offers rules avalable to be applied to a FieldValue.
Note that for diffent FieldValue, the same rule might mean diffent.
For example, Max means the maximum length for str value, but means
the maximum value for integer value.
Variants§
Max(i64)
Maximum limit.
Min(i64)
Mininum limit.
Format(&'static str)
A regex pattern to match against the str representation of FieldValue.
Lambda(Box<dyn Fn(FieldValue) -> bool>, Option<Box<dyn Fn(&str, &str, &str) -> String>>)
A customized lambda, to let you offer your own check logic.
Auto Trait Implementations§
impl Freeze for Rule
impl !RefUnwindSafe for Rule
impl !Send for Rule
impl !Sync for Rule
impl Unpin 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