pub struct ConditionalValidator { /* private fields */ }Expand description
Conditional validation engine for field dependencies
Implementationsยง
Sourceยงimpl ConditionalValidator
impl ConditionalValidator
Sourcepub fn add_rule(&mut self, rule: ConditionalRule)
pub fn add_rule(&mut self, rule: ConditionalRule)
Add a conditional rule
Sourcepub fn validate_conditional_fields<T: Form>(
&self,
form: &T,
field_name: &str,
field_value: &FieldValue,
) -> Result<(), String>
pub fn validate_conditional_fields<T: Form>( &self, form: &T, field_name: &str, field_value: &FieldValue, ) -> Result<(), String>
Validate conditional fields
Sourcepub fn get_rules_for_field(&self, field_name: &str) -> Vec<&ConditionalRule>
pub fn get_rules_for_field(&self, field_name: &str) -> Vec<&ConditionalRule>
Get all rules for a specific field
Sourcepub fn has_rules_for_field(&self, field_name: &str) -> bool
pub fn has_rules_for_field(&self, field_name: &str) -> bool
Check if a field has conditional rules
Sourcepub fn get_all_rules(&self) -> &[ConditionalRule]
pub fn get_all_rules(&self) -> &[ConditionalRule]
Get all conditional rules
Sourcepub fn clear_rules(&mut self)
pub fn clear_rules(&mut self)
Clear all conditional rules
Sourcepub fn remove_rules_for_field(&mut self, field_name: &str)
pub fn remove_rules_for_field(&mut self, field_name: &str)
Remove rules for a specific field
Trait Implementationsยง
Sourceยงimpl Default for ConditionalValidator
impl Default for ConditionalValidator
Sourceยงfn default() -> ConditionalValidator
fn default() -> ConditionalValidator
Returns the โdefault valueโ for a type. Read more
Auto Trait Implementationsยง
impl Freeze for ConditionalValidator
impl !RefUnwindSafe for ConditionalValidator
impl Send for ConditionalValidator
impl Sync for ConditionalValidator
impl Unpin for ConditionalValidator
impl UnsafeUnpin for ConditionalValidator
impl !UnwindSafe for ConditionalValidator
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> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
Sourceยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Sourceยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Sourceยงfn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.