Expand description
HTML forms: binding, CSRF, rendering, multipart.
Structs§
- Bool
ToString Transformer - Maps truthy/falsy view strings to normalized
"1"/"0"model values. - Checkbox
Options - Options for
FieldKind::Checkbox. - Choice
Entry - One choice entry: submitted value and display label.
- Choice
Options - Options for
FieldKind::Choice. - Choice
ToValue Transformer - Ensures submitted values are members of a
ChoiceOptionslist. - Collection
Entry Builder - Describes fields repeated for each collection index.
- Collection
Prototype Meta - Metadata for progressive-enhancement HTML (no JS framework in core).
- Compound
Builder - Builds nested fields under a dotted name prefix.
- Field
- One named form field with kind, optional constraints, and current string value.
- File
Options - Options for
FieldKind::File. - Form
- HTML form with optional CSRF (on by default) and validator bridge.
- Form
Builder - Builds a
Form. - Hidden
Options - Options for
FieldKind::Hidden. - I64To
String Transformer - Parses and normalizes signed 64-bit integers as decimal strings.
- Multipart
Data - Parsed multipart form: text fields and file uploads.
- Number
Options - Options for
FieldKind::Number. - Password
Options - Options for
FieldKind::Password. - Rendered
Form - Escaped HTML produced by
crate::Form::render. - Text
Options - Options for
FieldKind::Text. - Textarea
Options - Options for
FieldKind::Textarea. - Uploaded
File - One uploaded file from a
multipart/form-datapart.
Enums§
- Field
Config - Typed configuration for a field (kind + options).
- Field
Kind - HTML-oriented field kind used for bind and render.
- File
Storage - How an uploaded file is retained after multipart parse.
- Form
Error - Form bind / CSRF / parse failure.
- Form
Status - Outcome after
Form::handle_request. - Nested
Data - Nested tree node produced by
unflatten_form_data.
Constants§
- COLLECTION_
PROTOTYPE_ INDEX - Placeholder index token used in HTML collection prototypes.
- CSRF_
FIELD_ NAME - Default HTML form field name for the CSRF token (Symfony
_token). - DEFAULT_
MAX_ FILE_ SIZE - Default per-file size limit enforced when
FileOptions::max_sizeis unset (2 MiB). - DEFAULT_
MAX_ MULTIPART_ BODY - Default multipart body size limit for
crate::parse_multipart(8 MiB).
Traits§
- Data
Transformer - Converts between the HTML view string and the model string stored on the field.
Functions§
- collection_
field_ name - Builds an indexed collection field name:
items[0][name]. - collection_
indices - Lists numeric indices present for
collectionin a flat map (items[0][…]). - collection_
prototype_ field_ name - Builds a prototype field name using
COLLECTION_PROTOTYPE_INDEX. - escape_
attr - Escapes a value for use inside a double-quoted HTML attribute.
- escape_
html - Escapes text for HTML body content (
&,<,>,",'). - form_
csrf - Renders the CSRF hidden input when CSRF is enabled on
form. - form_
errors - Renders escaped error messages for
fieldfromviolations. - form_
label - Renders a field label (
<label for="…">…</label>), HTML-escaped. - form_
row - Renders label + widget + errors for one field (all escaped).
- form_
widget - Renders the field widget only (no label), with values and attributes escaped.
- is_
multipart - Returns
truewhencontent_typeismultipart/form-data. - join_
multi - Joins multi-values with a single space (stable round-trip for choice multi).
- multipart_
boundary - Extracts the
boundaryparameter from aContent-Typeheader value. - parse_
form_ body - Parses urlencoded or multipart from a request body using
Content-Type. - parse_
multipart - Parses a
multipart/form-databody. - parse_
urlencoded - Parses a URL-encoded form body into string fields (last value wins on duplicates).
- parse_
urlencoded_ multi - Parses a URL-encoded body keeping every value for each key (submission order).
- split_
multi - Splits a multi-value model/view string on ASCII whitespace.
- unflatten_
form_ data - Builds a nested map from flat urlencoded keys (
address.street,items[0][name]).