pub struct FormFieldA11y {Show 15 fields
pub id: String,
pub label: Option<String>,
pub input_type: Option<InputType>,
pub required: bool,
pub has_visual_required_indicator: bool,
pub aria_required: bool,
pub aria_label: Option<String>,
pub aria_labelledby: Option<String>,
pub aria_describedby: Option<String>,
pub has_error: bool,
pub aria_invalid: bool,
pub aria_errormessage: Option<String>,
pub error_message: Option<String>,
pub autocomplete: Option<AutocompleteValue>,
pub placeholder: Option<String>,
}Expand description
Form field accessibility descriptor.
Fields§
§id: StringField ID
label: Option<String>Associated label text
input_type: Option<InputType>Input type
required: boolIs required
has_visual_required_indicator: boolHas visual required indicator
aria_required: boolaria-required attribute
aria_label: Option<String>aria-label attribute
aria_labelledby: Option<String>aria-labelledby attribute
aria_describedby: Option<String>aria-describedby attribute
has_error: boolHas error state
aria_invalid: boolaria-invalid attribute
aria_errormessage: Option<String>aria-errormessage attribute
error_message: Option<String>Error message text
autocomplete: Option<AutocompleteValue>Autocomplete attribute
placeholder: Option<String>Placeholder text
Implementations§
Source§impl FormFieldA11y
impl FormFieldA11y
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set label.
Sourcepub fn with_required(self, visual: bool, aria: bool) -> Self
pub fn with_required(self, visual: bool, aria: bool) -> Self
Set required with specific options.
Sourcepub fn with_error(self, message: impl Into<String>, associated: bool) -> Self
pub fn with_error(self, message: impl Into<String>, associated: bool) -> Self
Set error state.
Sourcepub fn with_autocomplete(self, value: AutocompleteValue) -> Self
pub fn with_autocomplete(self, value: AutocompleteValue) -> Self
Set autocomplete.
Sourcepub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
pub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
Set placeholder.
Sourcepub fn with_aria_label(self, label: impl Into<String>) -> Self
pub fn with_aria_label(self, label: impl Into<String>) -> Self
Set aria-label.
Trait Implementations§
Source§impl Clone for FormFieldA11y
impl Clone for FormFieldA11y
Source§fn clone(&self) -> FormFieldA11y
fn clone(&self) -> FormFieldA11y
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 FormFieldA11y
impl Debug for FormFieldA11y
Source§impl Default for FormFieldA11y
impl Default for FormFieldA11y
Source§fn default() -> FormFieldA11y
fn default() -> FormFieldA11y
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FormFieldA11y
impl RefUnwindSafe for FormFieldA11y
impl Send for FormFieldA11y
impl Sync for FormFieldA11y
impl Unpin for FormFieldA11y
impl UnwindSafe for FormFieldA11y
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