pub enum FieldCondition {
Equals(String, FieldValue),
NotEquals(String, FieldValue),
Contains(String, String),
IsEmpty(String),
IsNotEmpty(String),
And(Vec<FieldCondition>),
Or(Vec<FieldCondition>),
}Expand description
Field conditions for conditional validation
Variantsยง
Equals(String, FieldValue)
NotEquals(String, FieldValue)
Contains(String, String)
IsEmpty(String)
IsNotEmpty(String)
And(Vec<FieldCondition>)
Or(Vec<FieldCondition>)
Implementationsยง
Sourceยงimpl FieldCondition
impl FieldCondition
Sourcepub fn equals(field: &str, value: FieldValue) -> Self
pub fn equals(field: &str, value: FieldValue) -> Self
Create an equals condition
Sourcepub fn not_equals(field: &str, value: FieldValue) -> Self
pub fn not_equals(field: &str, value: FieldValue) -> Self
Create a not equals condition
Sourcepub fn is_not_empty(field: &str) -> Self
pub fn is_not_empty(field: &str) -> Self
Create an is not empty condition
Sourcepub fn and(conditions: Vec<FieldCondition>) -> Self
pub fn and(conditions: Vec<FieldCondition>) -> Self
Create an AND condition
Sourcepub fn or(conditions: Vec<FieldCondition>) -> Self
pub fn or(conditions: Vec<FieldCondition>) -> Self
Create an OR condition
Sourcepub fn field_name(&self) -> Option<&str>
pub fn field_name(&self) -> Option<&str>
Get the field name for this condition
Sourcepub fn is_logical_operator(&self) -> bool
pub fn is_logical_operator(&self) -> bool
Check if this condition is a logical operator
Sourcepub fn logical_operator_type(&self) -> Option<LogicalOperator>
pub fn logical_operator_type(&self) -> Option<LogicalOperator>
Get the logical operator type if this is a logical operator
Trait Implementationsยง
Sourceยงimpl Clone for FieldCondition
impl Clone for FieldCondition
Sourceยงfn clone(&self) -> FieldCondition
fn clone(&self) -> FieldCondition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementationsยง
impl Freeze for FieldCondition
impl RefUnwindSafe for FieldCondition
impl Send for FieldCondition
impl Sync for FieldCondition
impl Unpin for FieldCondition
impl UnsafeUnpin for FieldCondition
impl UnwindSafe for FieldCondition
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<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.