Skip to main content

validate_fields

Function validate_fields 

Source
pub fn validate_fields(
    fields: &[FieldRules],
    data: &HashMap<String, String>,
    mode: Mode,
) -> ErrorBag
Expand description

Runs the cheap, non-database rules over data for mode, returning the error bag. Rule::Unique needs the database and is ignored here; use validate to include it. Exposed on its own for callers that want a DB-free check (for example an API validating a payload before any query).