pub struct FieldMeta { /* private fields */ }Expand description
Signal-backed presentation metadata for one field-shaped value.
The flag meanings are producer-defined. This type does not track an initial value or classify validity. Error strings are already formatted for display before they cross this boundary.
Implementations§
Source§impl FieldMeta
impl FieldMeta
Sourcepub fn set_required(&mut self, required: bool)
pub fn set_required(&mut self, required: bool)
Replaces the producer-defined required state.
Sourcepub fn set_disabled(&mut self, disabled: bool)
pub fn set_disabled(&mut self, disabled: bool)
Replaces the producer-defined disabled state.
Sourcepub fn invalid(&self) -> bool
pub fn invalid(&self) -> bool
Returns whether the field is invalid.
An explicit invalid state wins; otherwise invalidity is derived from whether errors exist.
Sourcepub fn set_invalid(&mut self, invalid: Option<bool>)
pub fn set_invalid(&mut self, invalid: Option<bool>)
Sets an explicit invalid state, or restores error-derived invalidity with None.
Sourcepub fn set_errors(&mut self, errors: Vec<Rc<str>>)
pub fn set_errors(&mut self, errors: Vec<Rc<str>>)
Replaces the pre-rendered error text.
Sourcepub fn set_touched(&mut self, touched: bool)
pub fn set_touched(&mut self, touched: bool)
Replaces the producer-defined touched state.
Sourcepub fn register_description_id(
&mut self,
id: Rc<str>,
) -> FieldMetaIdRegistration
pub fn register_description_id( &mut self, id: Rc<str>, ) -> FieldMetaIdRegistration
Registers a description element id until the returned registration is dropped.
Sourcepub fn register_error_id(&mut self, id: Rc<str>) -> FieldMetaIdRegistration
pub fn register_error_id(&mut self, id: Rc<str>) -> FieldMetaIdRegistration
Registers an error element id until the returned registration is dropped.
Sourcepub fn attributes(&self) -> Vec<Attribute>
pub fn attributes(&self) -> Vec<Attribute>
Returns attributes for a rendered control using the metadata’s flag states.
Sourcepub fn attributes_with(&self, overrides: FieldMetaOverrides) -> Vec<Attribute>
pub fn attributes_with(&self, overrides: FieldMetaOverrides) -> Vec<Attribute>
Returns attributes for a rendered control, applying per-flag explicit overrides.
Sourcepub fn set_values(&mut self, values: FieldMetaValues)
pub fn set_values(&mut self, values: FieldMetaValues)
Replaces producer-owned metadata values without disturbing registered part ids.