Trait rooting_forms::Form
source · pub trait Form {
// Required method
fn new_form(field: &str, from: Option<&Self>) -> Box<dyn FormState<Self>>;
}Expand description
Provides methods for creating forms from a type. All types that can appear as
or within such forms must implement this. This is automatically implemented for
FormWith<()> so if implementing yourself, focus on that trait.
Required Methods§
sourcefn new_form(field: &str, from: Option<&Self>) -> Box<dyn FormState<Self>>
fn new_form(field: &str, from: Option<&Self>) -> Box<dyn FormState<Self>>
Generates a form state manager to produce form elements and parse the entered values.
-
field- is the field name, for accessibility usingaria-label.<label>isn’t used sometime due to anonymous fields in tuples. -
from- data used to populate the initial form, for example if creating a form to edit existing data.
Object Safety§
This trait is not object safe.