pub struct FormField {
pub id: String,
pub label: String,
pub field_type: FormFieldType,
pub required: bool,
pub default_value: Option<Value>,
pub validation: Option<Value>,
pub options: Vec<String>,
}Expand description
A field in a form
Fields§
§id: StringField identifier (used in result mapping)
label: StringField label shown to user
field_type: FormFieldTypeField type (text, number, email, select, etc.)
required: boolWhether this field is required
default_value: Option<Value>Default value
validation: Option<Value>Validation rules (regex, min, max, etc.)
options: Vec<String>For select/radio fields, the available options
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FormField
impl<'de> Deserialize<'de> for FormField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FormField
impl RefUnwindSafe for FormField
impl Send for FormField
impl Sync for FormField
impl Unpin for FormField
impl UnwindSafe for FormField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more