pub enum ValidationRule {
Range {
min: f64,
max: f64,
},
Enum {
allowed: Vec<u16>,
},
StringEnum {
allowed: Vec<&'static str>,
},
Required,
Conditional {
when: PropertyId,
has: PropertyValue,
},
}Expand description
Validation rule for a property
Variants§
Range
Range validation for numbers (min, max)
Enum
Enum validation (allowed values as u16)
StringEnum
String enum validation (allowed string values)
Required
Required property (must be present)
Conditional
Conditional validation (when property X has value Y, this must be Z)
Trait Implementations§
Source§impl Clone for ValidationRule
impl Clone for ValidationRule
Source§fn clone(&self) -> ValidationRule
fn clone(&self) -> ValidationRule
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 ValidationRule
impl Debug for ValidationRule
Source§impl PartialEq for ValidationRule
impl PartialEq for ValidationRule
impl StructuralPartialEq for ValidationRule
Auto Trait Implementations§
impl Freeze for ValidationRule
impl RefUnwindSafe for ValidationRule
impl Send for ValidationRule
impl Sync for ValidationRule
impl Unpin for ValidationRule
impl UnsafeUnpin for ValidationRule
impl UnwindSafe for ValidationRule
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