pub struct FieldMetadata {
pub name: String,
pub label: Option<String>,
pub required: bool,
pub help_text: Option<String>,
pub widget: Widget,
pub initial: Option<Value>,
}Expand description
Serializable field metadata for client-side rendering (Week 5 Day 1)
This structure contains all information needed to render a single form field on the client-side.
§Fields
name: Field name (used as form data key)label: Human-readable label (defaults to field name if None)required: Whether the field is requiredhelp_text: Help text displayed below the fieldwidget: Widget type for rendering (TextInput, Select, etc.)initial: Initial value for this field
Fields§
§name: StringField name
label: Option<String>Human-readable label (optional)
required: boolWhether the field is required
help_text: Option<String>Help text (optional)
widget: WidgetWidget type for rendering
initial: Option<Value>Initial value (optional)
Trait Implementations§
Source§impl Clone for FieldMetadata
impl Clone for FieldMetadata
Source§fn clone(&self) -> FieldMetadata
fn clone(&self) -> FieldMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldMetadata
impl Debug for FieldMetadata
Source§impl<'de> Deserialize<'de> for FieldMetadata
impl<'de> Deserialize<'de> for FieldMetadata
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 FieldMetadata
impl RefUnwindSafe for FieldMetadata
impl Send for FieldMetadata
impl Sync for FieldMetadata
impl Unpin for FieldMetadata
impl UnsafeUnpin for FieldMetadata
impl UnwindSafe for FieldMetadata
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