Trait mango_orm::forms::validation::ValidationForm[][src]

pub trait ValidationForm: ToForm + CachingForm + AdditionalValidation {
    fn check_minlength(
        minlength: usize,
        value: &str
    ) -> Result<(), Box<dyn Error>> { ... }
fn check_maxlength(
        maxlength: usize,
        value: &str
    ) -> Result<(), Box<dyn Error>> { ... }
fn accumula_err(
        widget: &Widget,
        err: &String
    ) -> Result<String, Box<dyn Error>> { ... }
fn regex_validation(
        field_type: &str,
        value: &str
    ) -> Result<(), Box<dyn Error>> { ... }
fn check(&self) -> Result<OutputDataForm, Box<dyn Error>> { ... } }
Expand description

Validating Form fields for save and update.

Provided methods

Validation of minlength.

Validation of maxlength.

Accumulation of errors.

Validation in regular expression (email, password, etc…).

Checking the Form before other proceeding.

Example:

let restore_password = RestorePasswordForm {...}
let result = restore_password.check()?;
assert!(result.is_valid());

Implementors