pub enum ValidationRule {
Required,
Type(AttributeType),
Enum(Vec<String>),
Regex(String),
Uri,
Email,
Date,
DateTime,
Range {
min: Option<i64>,
max: Option<i64>,
},
Length {
min: Option<usize>,
max: Option<usize>,
},
Custom(String),
Dependency {
depends_on: QName,
condition: DependencyCondition,
},
}
Expand description
Attribute validation rule definition
Variants§
Required
Attribute is required
Type(AttributeType)
Must match specific type
Enum(Vec<String>)
Must be one of specified enum values
Regex(String)
Must match regular expression
Uri
Must be valid URI
Must be valid email address
Date
Must be valid ISO date (YYYY-MM-DD)
DateTime
Must be valid ISO datetime
Range
Numeric range validation (using i64 for Eq compliance)
Length
String length validation
Custom(String)
Custom validation function (by name)
Dependency
Cross-attribute dependency
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<'de> Deserialize<'de> for ValidationRule
impl<'de> Deserialize<'de> for ValidationRule
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 ValidationRule
impl PartialEq for ValidationRule
Source§impl Serialize for ValidationRule
impl Serialize for ValidationRule
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.