pub trait FormFields {
type Field;
type Keys;
// Required method
fn keys() -> Self::Keys;
}Expand description
The fields a submission’s errors name: a record form’s or a form input’s, or the panel’s own
form keys (String).
The RecordForm, ModelForm and
FormInput derives implement it, so an app keys its errors by its
form, FieldErrors<UserForm>, and picks a field by its name, errors.add(|f| f.age, ..).
The field enum the derive writes, UserFormField, is the transport: the key the panel posts
and renders an error under, which an app’s code never needs to spell.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FormFields for ()
No input: an action runs on its button.
impl FormFields for ()
No input: an action runs on its button.
Source§impl FormFields for String
The panel’s own errors, keyed by the form key they render under.
impl FormFields for String
The panel’s own errors, keyed by the form key they render under.