pub struct ValidationRuleEngine { /* private fields */ }Expand description
Validation rule engine
Implementationsยง
Sourceยงimpl ValidationRuleEngine
impl ValidationRuleEngine
Sourcepub fn register_validator(&mut self, name: &str, validator: FieldValidator)
pub fn register_validator(&mut self, name: &str, validator: FieldValidator)
Register a custom validator
Sourcepub fn add_validator(&mut self, _validator: Validator)
pub fn add_validator(&mut self, _validator: Validator)
Add a validator (alias for register_validator)
Sourcepub fn validate_value(&self, value: FieldValue) -> Result<(), ValidationErrors>
pub fn validate_value(&self, value: FieldValue) -> Result<(), ValidationErrors>
Validate a value against the engine
Sourcepub fn validate_field(
&self,
_field_name: &str,
value: &FieldValue,
validators: &[Validator],
) -> Vec<String>
pub fn validate_field( &self, _field_name: &str, value: &FieldValue, validators: &[Validator], ) -> Vec<String>
Validate a field against a list of validators
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for ValidationRuleEngine
impl !RefUnwindSafe for ValidationRuleEngine
impl Send for ValidationRuleEngine
impl Sync for ValidationRuleEngine
impl Unpin for ValidationRuleEngine
impl UnsafeUnpin for ValidationRuleEngine
impl !UnwindSafe for ValidationRuleEngine
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.