Parsing and validation of HTTP forms and fields.
See the forms guide for general form support documentation.
Rocket’s field wire format is a flexible, non-self-descriptive, text-based encoding of arbitrarily nested structure keys and their corresponding values. The general grammar is:
field := name ('=' value)? name := key* key := indices | '[' indices ']' | '.' indices indices := index (':' index)* index := STRING except ':', ']' value := STRING
Each field name consists of any number of
keys and at most one
Keys are delimited by
key consists of indices delimited by
The meaning of a key or index is type-dependent, hence the format is
non-self-descriptive. Any structure can be described by this format. The
] have no semantic meaning.
Some examples of valid fields are:
- Form error types.
- Types for field names, name keys, and key indices.
- Form field validation routines.
- A form context containing received fields, values, and encountered errors.
- An infallible form guard that records form fields and errors during parsing.
- A multipart form field with an underlying data stream.
- A form error, potentially tied to a specific form field.
- A collection of
- A data guard for
- A form guard for parsing form types leniently.
- Form guard options.
- A form guard for parsing form types strictly.
- A form field with a string value.
- Trait implemented by form guards: types parseable from HTTP forms.
- Implied form guard (
FromForm) for parsing a single form field.
- Type alias for
Resultwith an error type of