Struct html::forms::Option

source ·
#[non_exhaustive]
pub struct Option { /* private fields */ }
Expand description

The HTML <option> element

MDN Documentation

Implementations§

source§

impl Option

source

pub fn builder() -> OptionBuilder

Create a new builder

source§

impl Option

source

pub fn data_map(&self) -> &DataMap

Access the element’s data-* properties

source

pub fn data_map_mut(&mut self) -> &mut DataMap

Mutably access the element’s data-* properties

source§

impl Option

source

pub fn disabled(&self) -> bool

Get the value of the disabled attribute

source

pub fn set_disabled(&mut self, value: bool)

Set the value of the disabled attribute

source

pub fn label(&self) -> Option<&str>

Get the value of the label attribute

source

pub fn set_label(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the label attribute

source

pub fn selected(&self) -> bool

Get the value of the selected attribute

source

pub fn set_selected(&mut self, value: bool)

Set the value of the selected attribute

source

pub fn value(&self) -> Option<&str>

Get the value of the value attribute

source

pub fn set_value(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the value attribute

source

pub fn role(&self) -> Option<&str>

Get the value of the role attribute

source

pub fn set_role(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the role attribute

source

pub fn aria_atomic(&self) -> bool

Get the value of the aria-atomic attribute

source

pub fn set_aria_atomic(&mut self, value: bool)

Set the value of the aria-atomic attribute

source

pub fn aria_braille_label(&self) -> Option<&str>

Get the value of the aria-braillelabel attribute

source

pub fn set_aria_braille_label( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-braillelabel attribute

source

pub fn aria_braille_role_description(&self) -> Option<&str>

Get the value of the aria-brailleroledescription attribute

source

pub fn set_aria_braille_role_description( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-brailleroledescription attribute

source

pub fn aria_busy(&self) -> bool

Get the value of the aria-busy attribute

source

pub fn set_aria_busy(&mut self, value: bool)

Set the value of the aria-busy attribute

source

pub fn aria_checked(&self) -> Option<&str>

Get the value of the aria-checked attribute

source

pub fn set_aria_checked(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the aria-checked attribute

source

pub fn aria_controls_elements(&self) -> Option<&str>

Get the value of the aria-controls attribute

source

pub fn set_aria_controls_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-controls attribute

source

pub fn aria_current(&self) -> Option<&str>

Get the value of the aria-current attribute

source

pub fn set_aria_current(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the aria-current attribute

source

pub fn aria_described_by_elements(&self) -> Option<&str>

Get the value of the aria-describedby attribute

source

pub fn set_aria_described_by_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-describedby attribute

source

pub fn aria_description(&self) -> Option<&str>

Get the value of the aria-description attribute

source

pub fn set_aria_description( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-description attribute

source

pub fn aria_details_elements(&self) -> Option<&str>

Get the value of the aria-details attribute

source

pub fn set_aria_details_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-details attribute

source

pub fn aria_disabled(&self) -> bool

Get the value of the aria-disabled attribute

source

pub fn set_aria_disabled(&mut self, value: bool)

Set the value of the aria-disabled attribute

source

pub fn aria_drop_effect(&self) -> Option<&str>

Get the value of the aria-dropeffect attribute

source

pub fn set_aria_drop_effect( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-dropeffect attribute

source

pub fn aria_error_message_elements(&self) -> Option<&str>

Get the value of the aria-errormessage attribute

source

pub fn set_aria_error_message_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-errormessage attribute

source

pub fn aria_flow_to_elements(&self) -> Option<&str>

Get the value of the aria-flowto attribute

source

pub fn set_aria_flow_to_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-flowto attribute

source

pub fn aria_grabbed(&self) -> bool

Get the value of the aria-grabbed attribute

source

pub fn set_aria_grabbed(&mut self, value: bool)

Set the value of the aria-grabbed attribute

source

pub fn aria_has_popup(&self) -> Option<&str>

Get the value of the aria-haspopup attribute

source

pub fn set_aria_has_popup( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-haspopup attribute

source

pub fn aria_hidden(&self) -> bool

Get the value of the aria-hidden attribute

source

pub fn set_aria_hidden(&mut self, value: bool)

Set the value of the aria-hidden attribute

source

pub fn aria_invalid(&self) -> Option<&str>

Get the value of the aria-invalid attribute

source

pub fn set_aria_invalid(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the aria-invalid attribute

source

pub fn aria_key_shortcuts(&self) -> Option<&str>

Get the value of the aria-keyshortcuts attribute

source

pub fn set_aria_key_shortcuts( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-keyshortcuts attribute

source

pub fn aria_label(&self) -> Option<&str>

Get the value of the aria-label attribute

source

pub fn set_aria_label(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the aria-label attribute

source

pub fn aria_labelled_by_elements(&self) -> Option<&str>

Get the value of the aria-labelledby attribute

source

pub fn set_aria_labelled_by_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-labelledby attribute

source

pub fn aria_live(&self) -> Option<&str>

Get the value of the aria-live attribute

source

pub fn set_aria_live(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the aria-live attribute

source

pub fn aria_owns_elements(&self) -> Option<&str>

Get the value of the aria-owns attribute

source

pub fn set_aria_owns_elements( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-owns attribute

source

pub fn aria_pos_in_set(&self) -> Option<i64>

Get the value of the aria-posinset attribute

source

pub fn set_aria_pos_in_set(&mut self, value: Option<i64>)

Set the value of the aria-posinset attribute

source

pub fn aria_relevant(&self) -> Option<&str>

Get the value of the aria-relevant attribute

source

pub fn set_aria_relevant(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the aria-relevant attribute

source

pub fn aria_role_description(&self) -> Option<&str>

Get the value of the aria-roledescription attribute

source

pub fn set_aria_role_description( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the aria-roledescription attribute

source

pub fn aria_selected(&self) -> bool

Get the value of the aria-selected attribute

source

pub fn set_aria_selected(&mut self, value: bool)

Set the value of the aria-selected attribute

source

pub fn aria_set_size(&self) -> Option<i64>

Get the value of the aria-setsize attribute

source

pub fn set_aria_set_size(&mut self, value: Option<i64>)

Set the value of the aria-setsize attribute

source

pub fn access_key(&self) -> Option<&str>

Get the value of the accesskey attribute

source

pub fn set_access_key(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the accesskey attribute

source

pub fn auto_capitalize(&self) -> Option<&str>

Get the value of the autocapitalize attribute

source

pub fn set_auto_capitalize( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the autocapitalize attribute

source

pub fn autofocus(&self) -> bool

Get the value of the autofocus attribute

source

pub fn set_autofocus(&mut self, value: bool)

Set the value of the autofocus attribute

source

pub fn class(&self) -> Option<&str>

Get the value of the class attribute

source

pub fn set_class(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the class attribute

source

pub fn content_editable(&self) -> Option<&str>

Get the value of the contenteditable attribute

source

pub fn set_content_editable( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the contenteditable attribute

source

pub fn direction(&self) -> Option<&str>

Get the value of the dir attribute

source

pub fn set_direction(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the dir attribute

source

pub fn draggable(&self) -> bool

Get the value of the draggable attribute

source

pub fn set_draggable(&mut self, value: bool)

Set the value of the draggable attribute

source

pub fn enter_key_hint(&self) -> Option<&str>

Get the value of the enterkeyhint attribute

source

pub fn set_enter_key_hint( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the enterkeyhint attribute

source

pub fn export_parts(&self) -> Option<&str>

Get the value of the exportparts attribute

source

pub fn set_export_parts(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the exportparts attribute

source

pub fn hidden(&self) -> Option<&str>

Get the value of the hidden attribute

source

pub fn set_hidden(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the hidden attribute

source

pub fn id(&self) -> Option<&str>

Get the value of the id attribute

source

pub fn set_id(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the id attribute

source

pub fn inert(&self) -> bool

Get the value of the inert attribute

source

pub fn set_inert(&mut self, value: bool)

Set the value of the inert attribute

source

pub fn input_mode(&self) -> Option<&str>

Get the value of the inputmode attribute

source

pub fn set_input_mode(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the inputmode attribute

source

pub fn is_(&self) -> Option<&str>

Get the value of the is attribute

source

pub fn set_is_(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the is attribute

source

pub fn item_id(&self) -> Option<&str>

Get the value of the itemid attribute

source

pub fn set_item_id(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemid attribute

source

pub fn item_prop(&self) -> Option<&str>

Get the value of the itemprop attribute

source

pub fn set_item_prop(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemprop attribute

source

pub fn item_ref(&self) -> Option<&str>

Get the value of the itemref attribute

source

pub fn set_item_ref(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemref attribute

source

pub fn item_scope(&self) -> Option<&str>

Get the value of the itemscope attribute

source

pub fn set_item_scope(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemscope attribute

source

pub fn item_type(&self) -> Option<&str>

Get the value of the itemtype attribute

source

pub fn set_item_type(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemtype attribute

source

pub fn lang(&self) -> Option<&str>

Get the value of the lang attribute

source

pub fn set_lang(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the lang attribute

source

pub fn nonce(&self) -> Option<&str>

Get the value of the nonce attribute

source

pub fn set_nonce(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the nonce attribute

source

pub fn part(&self) -> Option<&str>

Get the value of the part attribute

source

pub fn set_part(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the part attribute

source

pub fn slot(&self) -> Option<&str>

Get the value of the slot attribute

source

pub fn set_slot(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the slot attribute

source

pub fn spellcheck(&self) -> Option<&str>

Get the value of the spellcheck attribute

source

pub fn set_spellcheck(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the spellcheck attribute

source

pub fn style(&self) -> Option<&str>

Get the value of the style attribute

source

pub fn set_style(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the style attribute

source

pub fn tab_index(&self) -> Option<i64>

Get the value of the tabindex attribute

source

pub fn set_tab_index(&mut self, value: Option<i64>)

Set the value of the tabindex attribute

source

pub fn title(&self) -> Option<&str>

Get the value of the title attribute

source

pub fn set_title(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the title attribute

source

pub fn translate(&self) -> bool

Get the value of the translate attribute

source

pub fn set_translate(&mut self, value: bool)

Set the value of the translate attribute

source§

impl Option

source

pub fn children(&self) -> &[OptionChild]

Access the element’s children

source

pub fn children_mut(&mut self) -> &mut Vec<OptionChild>

Mutably access the element’s children

Trait Implementations§

source§

impl Clone for Option

source§

fn clone(&self) -> Option

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 Option

source§

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

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

impl Default for Option

source§

fn default() -> Option

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

impl Display for Option

source§

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

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

impl From<Option> for AnchorChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for AudioChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for CanvasChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for DataListChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for DeletedTextChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for ImageMapChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for InsertedTextChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for NoScriptChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for ObjectChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for Option

source§

fn from(sys: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for OptionGroupChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for SelectChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for SlotChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl From<Option> for VideoChild

source§

fn from(value: Option) -> Self

Converts to this type from the input type.
source§

impl Into<Option> for Option

source§

fn into(self) -> Option

Converts this type into the (usually inferred) input type.
source§

impl PartialEq for Option

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Render for Option

source§

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

Render an element with a given depth argument.
source§

impl HtmlElement for Option

source§

impl StructuralPartialEq for Option

Auto Trait Implementations§

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> 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<T> ToOwned for T
where T: Clone,

§

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§

default 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>,

§

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>,

§

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.