Trait mango_orm::models::validation::ValidationModel
source · [−]pub trait ValidationModel {
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_unique(
hash: &str,
field_name: &str,
bson_field_value: &Bson,
coll: &Collection
) -> Result<(), Box<dyn Error>> { ... }
}
Expand description
Validating Model fields for save and update.
Provided Methods
Validation of minlength
.
Validation of maxlength
.
Accumulation of errors.
Validation in regular expression (email, password, etc…).
fn check_unique(
hash: &str,
field_name: &str,
bson_field_value: &Bson,
coll: &Collection
) -> Result<(), Box<dyn Error>>
fn check_unique(
hash: &str,
field_name: &str,
bson_field_value: &Bson,
coll: &Collection
) -> Result<(), Box<dyn Error>>
Validation of unique
.