Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

cargo add fortifier

Features

General

  • macros (default) - Derive macro for the Validate trait (fortifier-macros).
  • message - Add a human-readable message field to validation errors.

Types

  • all-types - Enable all features below.
  • chrono - Support for the DateTime, NaiveDate, NaiveDateTime, NaiveTime and TimeDelta types from the chrono crate.
  • decimal - Support for the Decimal type from the rust_decimal crate.
  • indexmap - Support for the IndexMap and IndexSet types from the indexmap crate.
  • uuid - Support for the Uuid type from the uuid crate.

Validations

  • all-validations - Enable all features below.
  • email-address - Email address validation using the email_address crate.
  • phone-number - Phone number validation using the phonenumber crate.
  • regex - Regular expression validation using the regex crate.
  • url - URL validation using the url crate.

Integrations

  • serde - Support for the serde crate. Derives the Deserialize and Serialize traits for validation errors.
  • utoipa - Support for the utoipa crate. Derives the ToSchema trait for validation errors.