Enum validator::Validator[][src]

pub enum Validator {
    Email,
    Url,
    Custom {
        function: String,
        argument: 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,
}
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
Show fields

Fields of Custom

function: String

This is the name of the function that should be called

argument: Option<CustomArgument>

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

MustMatch(String)
Contains(String)
Regex(String)
Range
Show fields

Fields of Range

min: Option<ValueOrPath<f64>>max: Option<ValueOrPath<f64>>
Length
Show fields

Fields of Length

min: Option<ValueOrPath<u64>>max: Option<ValueOrPath<u64>>equal: Option<ValueOrPath<u64>>
Nested
Required
RequiredNested

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.