[][src]Crate form_validation

This is a library for validating data entry forms in a user interface.

Typically to use this library, you would implement Validatable for your form, and in the implementation use a Validator for each field in the form, and concatinating the results with concat_results().

Optional Features

  • "stdweb-support" - enable support for stdweb on the wasm32-unknown-unknown platform.
  • "wasm-bindgen-support" - enable for wasm-bindgen on the wasm32-unknown-unknown platform.
  • "async" - enable an asynchronous version of this API, and conversion traits from synchronous to asynchronous.

Structs

AsyncValidatorfeature="async"

Validates a particular type of value asynchronously, can contain many validation functions. Generally used with a single key for all contained validation functions.

AsyncValidatorFnfeature="async"

An function to perform validation on a field asynchonously.

ValidationError

An error associated with a form field.

ValidationErrors

A collection of ValidationErrors as a result of validating the fields of a form.

Validator

Validates a particular type of value, can contain many validation functions. Generally used with a single key for all contained validation functions.

ValidatorFn

Function to perform validation on a form field.

Traits

AsyncValidatablefeature="async"

An item that can be validated asynchronously.

Validatable

An item that can be validated.

Validation

A function/struct/item that can perform validation on an item with a given Value type.

Functions

concat_results

Join validation results, concatinating any errors they may contain. If any of the results are an Err it will return an Err containing all the errors from all the results.