Struct Button

Source
#[non_exhaustive]
pub struct Button {
Show 59 fields pub data_map: DataMap, pub disabled: bool, pub form: Option<Cow<'static, str>>, pub form_action: Option<Cow<'static, str>>, pub form_enctype: Option<Cow<'static, str>>, pub form_method: Option<Cow<'static, str>>, pub form_no_validate: bool, pub form_target: Option<Cow<'static, str>>, pub name: Option<Cow<'static, str>>, pub popovertarget: Option<Cow<'static, str>>, pub popovertargetaction: Option<Cow<'static, str>>, pub type_: Option<Cow<'static, str>>, pub value: Option<Cow<'static, str>>, pub role: Option<Cow<'static, str>>, pub aria_active_descendant_element: Option<Cow<'static, str>>, pub aria_atomic: bool, pub aria_auto_complete: Option<Cow<'static, str>>, pub aria_braille_label: Option<Cow<'static, str>>, pub aria_braille_role_description: Option<Cow<'static, str>>, pub aria_busy: bool, pub aria_checked: Option<Cow<'static, str>>, pub aria_col_index: Option<i64>, pub aria_col_index_text: Option<Cow<'static, str>>, pub aria_col_span: Option<i64>, pub aria_controls_elements: Option<Cow<'static, str>>, pub aria_current: Option<Cow<'static, str>>, pub aria_described_by_elements: Option<Cow<'static, str>>, pub aria_description: Option<Cow<'static, str>>, pub aria_details_elements: Option<Cow<'static, str>>, pub aria_disabled: bool, pub aria_drop_effect: Option<Cow<'static, str>>, pub aria_error_message_elements: Option<Cow<'static, str>>, pub aria_expanded: bool, pub aria_flow_to_elements: Option<Cow<'static, str>>, pub aria_grabbed: bool, pub aria_has_popup: Option<Cow<'static, str>>, pub aria_hidden: bool, pub aria_invalid: Option<Cow<'static, str>>, pub aria_key_shortcuts: Option<Cow<'static, str>>, pub aria_label: Option<Cow<'static, str>>, pub aria_labelled_by_elements: Option<Cow<'static, str>>, pub aria_level: Option<i64>, pub aria_live: Option<Cow<'static, str>>, pub aria_orientation: Option<Cow<'static, str>>, pub aria_owns_elements: Option<Cow<'static, str>>, pub aria_pos_in_set: Option<i64>, pub aria_pressed: Option<Cow<'static, str>>, pub aria_read_only: bool, pub aria_relevant: Option<Cow<'static, str>>, pub aria_required: bool, pub aria_role_description: Option<Cow<'static, str>>, pub aria_row_index: Option<i64>, pub aria_row_index_text: Option<Cow<'static, str>>, pub aria_row_span: Option<i64>, pub aria_selected: bool, pub aria_set_size: Option<i64>, pub aria_value_max: Option<f64>, pub aria_value_min: Option<f64>, pub aria_value_text: Option<Cow<'static, str>>, /* private fields */
}
Expand description

The HTML <button> element

MDN Documentation

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§data_map: DataMap§disabled: bool

Whether the form control is disabled

§form: Option<Cow<'static, str>>

Associates the element with a form element

§form_action: Option<Cow<'static, str>>

URL to use for form submission

§form_enctype: Option<Cow<'static, str>>

Entry list encoding type to use for form submission

§form_method: Option<Cow<'static, str>>

Variant to use for form submission

§form_no_validate: bool

Bypass form control validation for form submission

§form_target: Option<Cow<'static, str>>

Navigable for form submission

§name: Option<Cow<'static, str>>

Name of the element to use for form submission and in the form.elements API

§popovertarget: Option<Cow<'static, str>>

Targets a popover element to toggle, show, or hide

§popovertargetaction: Option<Cow<'static, str>>

Indicates whether a targeted popover element is to be toggled, shown, or hidden

§type_: Option<Cow<'static, str>>

Type of button

§value: Option<Cow<'static, str>>

Value to be used for form submission

§role: Option<Cow<'static, str>>

Describes the role(s) the current element plays in the context of the document.

§aria_active_descendant_element: Option<Cow<'static, str>>

Identifies the currently active element when DOM focus is on a composite widget, combobox, textbox, group, or application.

§aria_atomic: bool

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

§aria_auto_complete: Option<Cow<'static, str>>

Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for a combobox, searchbox, or textbox and specifies how predictions would be presented if they were made.

§aria_braille_label: Option<Cow<'static, str>>

Defines a string value that labels the current element, which is intended to be converted into Braille. See related aria-label.

§aria_braille_role_description: Option<Cow<'static, str>>

Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille. See related aria-roledescription.

§aria_busy: bool

Indicates an element is being modified and that assistive technologies could wait until the modifications are complete before exposing them to the user.

§aria_checked: Option<Cow<'static, str>>

Indicates the current “checked” state of checkboxes, radio buttons, and other widgets. See related aria-pressed and aria-selected.

§aria_col_index: Option<i64>

Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid. See related aria-colindextext, aria-colcount, and aria-colspan.

§aria_col_index_text: Option<Cow<'static, str>>

Defines a human readable text alternative of aria-colindex. See related aria-rowindextext.

§aria_col_span: Option<i64>

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. See related aria-colindex and aria-rowspan.

§aria_controls_elements: Option<Cow<'static, str>>

Identifies the element (or elements) whose contents or presence are controlled by the current element. See related aria-owns.

§aria_current: Option<Cow<'static, str>>

Indicates the element that represents the current item within a container or set of related elements.

§aria_described_by_elements: Option<Cow<'static, str>>

Identifies the element (or elements) that describes the object. See related aria-labelledby and aria-description.

§aria_description: Option<Cow<'static, str>>

Defines a string value that describes or annotates the current element. See related aria-describedby.

§aria_details_elements: Option<Cow<'static, str>>

Identifies the element (or elements) that provide additional information related to the object. See related aria-describedby.

§aria_disabled: bool

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. See related aria-hidden and aria-readonly.

§aria_drop_effect: Option<Cow<'static, str>>

[Deprecated in ARIA 1.1] Indicates what functions can be performed when a dragged object is released on the drop target.

§aria_error_message_elements: Option<Cow<'static, str>>

Identifies the element (or elements) that provides an error message for an object. See related aria-invalid and aria-describedby.

§aria_expanded: bool

Indicates whether a grouping element owned or controlled by this element is expanded or collapsed.

§aria_flow_to_elements: Option<Cow<'static, str>>

Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.

§aria_grabbed: bool

[Deprecated in ARIA 1.1] Indicates an element’s “grabbed” state in a drag-and-drop operation.

§aria_has_popup: Option<Cow<'static, str>>

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

§aria_hidden: bool

Indicates whether the element is exposed to an accessibility API. See related aria-disabled.

§aria_invalid: Option<Cow<'static, str>>

Indicates the entered value does not conform to the format expected by the application. See related aria-errormessage.

§aria_key_shortcuts: Option<Cow<'static, str>>

Defines keyboard shortcuts that an author has implemented to activate or give focus to an element.

§aria_label: Option<Cow<'static, str>>

Defines a string value that labels the current element. See related aria-labelledby.

§aria_labelled_by_elements: Option<Cow<'static, str>>

Identifies the element (or elements) that labels the current element. See related aria-label and aria-describedby.

§aria_level: Option<i64>

Defines the hierarchical level of an element within a structure.

§aria_live: Option<Cow<'static, str>>

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

§aria_orientation: Option<Cow<'static, str>>

Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.

§aria_owns_elements: Option<Cow<'static, str>>

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. See related aria-controls.

§aria_pos_in_set: Option<i64>

Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-setsize.

§aria_pressed: Option<Cow<'static, str>>

Indicates the current “pressed” state of toggle buttons. See related aria-checked and aria-selected.

§aria_read_only: bool

Indicates that the element is not editable, but is otherwise operable. See related aria-disabled.

§aria_relevant: Option<Cow<'static, str>>

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. See related aria-atomic.

§aria_required: bool

Indicates that user input is required on the element before a form can be submitted.

§aria_role_description: Option<Cow<'static, str>>

Defines a human-readable, author-localized description for the role of an element.

§aria_row_index: Option<i64>

Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid. See related aria-rowindextext, aria-rowcount, and aria-rowspan.

§aria_row_index_text: Option<Cow<'static, str>>

Defines a human readable text alternative of aria-rowindex. See related aria-colindextext.

§aria_row_span: Option<i64>

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. See related aria-rowindex and aria-colspan.

§aria_selected: bool

Indicates the current “selected” state of various widgets. See related aria-checked and aria-pressed.

§aria_set_size: Option<i64>

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-posinset.

§aria_value_max: Option<f64>

Defines the maximum allowed value for a range widget.

§aria_value_min: Option<f64>

Defines the minimum allowed value for a range widget.

§aria_value_text: Option<Cow<'static, str>>

Defines the human readable text alternative of aria-valuenow for a range widget.

Trait Implementations§

Source§

impl Clone for Button

Source§

fn clone(&self) -> Button

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Button

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Button

Source§

fn default() -> Button

Returns the “default value” for a type. Read more
Source§

impl Deref for Button

Source§

type Target = GlobalAttributes

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Button

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Display for Button

Source§

fn fmt(&self, writer: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Button

Source§

fn eq(&self, other: &Button) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RenderElement for Button

Source§

fn write_opening_tag<W: Write>(&self, writer: &mut W) -> Result

Write the opening tag to a writer.
Source§

fn write_closing_tag<W: Write>(&self, writer: &mut W) -> Result

Write the closing tag to a writer, if one is available.
Source§

impl StructuralPartialEq for Button

Auto Trait Implementations§

§

impl Freeze for Button

§

impl RefUnwindSafe for Button

§

impl Send for Button

§

impl Sync for Button

§

impl Unpin for Button

§

impl UnwindSafe for Button

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.