pub enum MustDefineRange {
Inclusive,
Exclusive,
}
Expand description
Two related fields must define a range.
This constraint is useful for structs with pairs of fields that define a
range such as valid_from
and valid_until
or min_salary
and
max_salary
.
The validation function can be applied in the RelatedFields
context.
It is implemented for all types T
that implement the PartialOrd
trait
and Into<Value
.
Variants§
Inclusive
The first value must be less than or equal to the second value
Exclusive
The first value must be less than the second value
Trait Implementations§
Source§impl Clone for MustDefineRange
impl Clone for MustDefineRange
Source§fn clone(&self) -> MustDefineRange
fn clone(&self) -> MustDefineRange
Returns a copy 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 MustDefineRange
impl Debug for MustDefineRange
Source§impl PartialEq for MustDefineRange
impl PartialEq for MustDefineRange
Source§impl<T> Validate<MustDefineRange, RelatedFields> for (T, T)
impl<T> Validate<MustDefineRange, RelatedFields> for (T, T)
Source§fn validate(
self,
fields: impl Into<RelatedFields>,
constraint: &MustDefineRange,
) -> Validation<MustDefineRange, Self>
fn validate( self, fields: impl Into<RelatedFields>, constraint: &MustDefineRange, ) -> Validation<MustDefineRange, Self>
Validates this value for being compliant to the specified constraint
C
in the given context S
.impl Copy for MustDefineRange
impl Eq for MustDefineRange
impl StructuralPartialEq for MustDefineRange
Auto Trait Implementations§
impl Freeze for MustDefineRange
impl RefUnwindSafe for MustDefineRange
impl Send for MustDefineRange
impl Sync for MustDefineRange
impl Unpin for MustDefineRange
impl UnwindSafe for MustDefineRange
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