pub trait FormScalar: Sized {
const INPUT_TYPE: &'static str = "text";
// Required methods
fn blank() -> Option<Self>;
fn parse_form(value: &str) -> Result<Self, String>;
fn to_form(&self) -> String;
}Expand description
A type one form key reads and writes: String, every TypedValue type,
and an Option of either.
The value the parse sees is trimmed and non-empty; an empty submission is the
field’s blank answer instead (the blank a record form declares, else
"" for String or None for an Option).
A text field binds a path of any FormScalar type
(Field::text), and the form derives read and write
every field that is not #[form(embed)] through it.
Provided Associated Constants§
Sourceconst INPUT_TYPE: &'static str = "text"
const INPUT_TYPE: &'static str = "text"
The type attribute of the text control that edits it.
Required Methods§
Sourcefn parse_form(value: &str) -> Result<Self, String>
fn parse_form(value: &str) -> Result<Self, String>
Parse a trimmed, non-empty submission, or return the error message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".