[][src]Enum valid::constraint::MustDefineRange

pub enum MustDefineRange {
    Inclusive,
    Exclusive,
}

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

impl Clone for MustDefineRange[src]

impl Copy for MustDefineRange[src]

impl Debug for MustDefineRange[src]

impl Eq for MustDefineRange[src]

impl PartialEq<MustDefineRange> for MustDefineRange[src]

impl StructuralEq for MustDefineRange[src]

impl StructuralPartialEq for MustDefineRange[src]

impl<T> Validate<MustDefineRange, RelatedFields> for (T, T) where
    T: PartialOrd + Into<Value>, 
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.