pub enum Validator {
    Email,
    Url,
    Custom {
        function: String,
        argument: Box<Option<CustomArgument>>,
    },
    MustMatch(String),
    Contains(String),
    Regex(String),
    Range {
        min: Option<ValueOrPath<f64>>,
        max: Option<ValueOrPath<f64>>,
    },
    Length {
        min: Option<ValueOrPath<u64>>,
        max: Option<ValueOrPath<u64>>,
        equal: Option<ValueOrPath<u64>>,
    },
    Nested,
    Required,
    RequiredNested,
    DoesNotContain(String),
}
Expand description

Contains all the validators that can be used

In this crate as it’s not allowed to export more than the proc macro in a proc macro crate

Variants

Email

Url

Custom

Fields

function: String

This is the name of the function that should be called

argument: Box<Option<CustomArgument>>

This is the argument type that can be passed in with a macro

MustMatch(String)

Contains(String)

Regex(String)

Range

Length

Nested

Required

RequiredNested

DoesNotContain(String)

Implementations

This returns the defined custom argument if it was defined

This returns the defined custom argument if it was defined

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.