pub enum FormFieldSpec {
Input {
html_type: String,
},
TextArea,
Select {
choices: Vec<(String, String)>,
},
MultiSelect {
choices: Vec<(String, String)>,
},
File,
Hidden,
}Expand description
Rendering specification for a form field.
This type preserves the structural information needed to emit the
correct HTML element (e.g., <input>, <textarea>, <select>),
along with any choices required for <select> options. It is derived
from FieldType via From<&FieldType>.
Variants§
Input
Plain <input> element with the given HTML type attribute.
Fields
html_type: StringValue for the HTML type attribute (e.g., “text”, “email”,
“number”, “checkbox”, “date”, “datetime-local”).
Owned String (not &'static str) so the variant can round-trip
through serde deserialization at API boundaries — borrowed
'static strings cannot be reconstructed from incoming JSON.
TextArea
<textarea> element for multi-line text.
Select
<select> dropdown with the given (value, label) choices.
MultiSelect
<select multiple> dropdown with the given (value, label) choices.
File
<input type="file"> for file uploads.
Hidden
<input type="hidden"> for hidden values.
Trait Implementations§
Source§impl Clone for FormFieldSpec
impl Clone for FormFieldSpec
Source§fn clone(&self) -> FormFieldSpec
fn clone(&self) -> FormFieldSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FormFieldSpec
impl Debug for FormFieldSpec
Source§impl<'de> Deserialize<'de> for FormFieldSpec
impl<'de> Deserialize<'de> for FormFieldSpec
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>,
Source§impl From<&FieldType> for FormFieldSpec
impl From<&FieldType> for FormFieldSpec
Source§impl PartialEq for FormFieldSpec
impl PartialEq for FormFieldSpec
Source§impl Serialize for FormFieldSpec
impl Serialize for FormFieldSpec
impl StructuralPartialEq for FormFieldSpec
Auto Trait Implementations§
impl Freeze for FormFieldSpec
impl RefUnwindSafe for FormFieldSpec
impl Send for FormFieldSpec
impl Sync for FormFieldSpec
impl Unpin for FormFieldSpec
impl UnsafeUnpin for FormFieldSpec
impl UnwindSafe for FormFieldSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more