pub mod element {
#[doc(alias = "select")]
#[non_exhaustive]
#[derive(PartialEq, Clone, Default)]
pub struct Select {
sys: html_sys::forms::Select,
children: Vec<super::child::SelectChild>,
}
impl Select {
pub fn builder() -> super::builder::SelectBuilder {
super::builder::SelectBuilder::new(Default::default())
}
}
impl Select {
pub fn data_map(&self) -> &html_sys::DataMap {
&self.sys.data_map
}
pub fn data_map_mut(&mut self) -> &mut html_sys::DataMap {
&mut self.sys.data_map
}
}
impl Select {
pub fn autocomplete(&self) -> std::option::Option<&str> {
self.sys.autocomplete.as_deref()
}
pub fn set_autocomplete(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.autocomplete = value.map(|v| v.into());
}
pub fn disabled(&self) -> bool {
self.sys.disabled
}
pub fn set_disabled(&mut self, value: bool) {
self.sys.disabled = value;
}
pub fn form(&self) -> std::option::Option<&str> {
self.sys.form.as_deref()
}
pub fn set_form(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.form = value.map(|v| v.into());
}
pub fn multiple(&self) -> bool {
self.sys.multiple
}
pub fn set_multiple(&mut self, value: bool) {
self.sys.multiple = value;
}
pub fn name(&self) -> std::option::Option<&str> {
self.sys.name.as_deref()
}
pub fn set_name(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.name = value.map(|v| v.into());
}
pub fn required(&self) -> bool {
self.sys.required
}
pub fn set_required(&mut self, value: bool) {
self.sys.required = value;
}
pub fn size(&self) -> std::option::Option<i64> {
self.sys.size
}
pub fn set_size(&mut self, value: std::option::Option<i64>) {
self.sys.size = value;
}
pub fn role(&self) -> std::option::Option<&str> {
self.sys.role.as_deref()
}
pub fn set_role(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.role = value.map(|v| v.into());
}
pub fn aria_active_descendant_element(&self) -> std::option::Option<&str> {
self.sys.aria_active_descendant_element.as_deref()
}
pub fn set_aria_active_descendant_element(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_active_descendant_element = value.map(|v| v.into());
}
pub fn aria_atomic(&self) -> bool {
self.sys.aria_atomic
}
pub fn set_aria_atomic(&mut self, value: bool) {
self.sys.aria_atomic = value;
}
pub fn aria_auto_complete(&self) -> std::option::Option<&str> {
self.sys.aria_auto_complete.as_deref()
}
pub fn set_aria_auto_complete(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_auto_complete = value.map(|v| v.into());
}
pub fn aria_braille_label(&self) -> std::option::Option<&str> {
self.sys.aria_braille_label.as_deref()
}
pub fn set_aria_braille_label(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_braille_label = value.map(|v| v.into());
}
pub fn aria_braille_role_description(&self) -> std::option::Option<&str> {
self.sys.aria_braille_role_description.as_deref()
}
pub fn set_aria_braille_role_description(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_braille_role_description = value.map(|v| v.into());
}
pub fn aria_busy(&self) -> bool {
self.sys.aria_busy
}
pub fn set_aria_busy(&mut self, value: bool) {
self.sys.aria_busy = value;
}
pub fn aria_controls_elements(&self) -> std::option::Option<&str> {
self.sys.aria_controls_elements.as_deref()
}
pub fn set_aria_controls_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_controls_elements = value.map(|v| v.into());
}
pub fn aria_current(&self) -> std::option::Option<&str> {
self.sys.aria_current.as_deref()
}
pub fn set_aria_current(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_current = value.map(|v| v.into());
}
pub fn aria_described_by_elements(&self) -> std::option::Option<&str> {
self.sys.aria_described_by_elements.as_deref()
}
pub fn set_aria_described_by_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_described_by_elements = value.map(|v| v.into());
}
pub fn aria_description(&self) -> std::option::Option<&str> {
self.sys.aria_description.as_deref()
}
pub fn set_aria_description(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_description = value.map(|v| v.into());
}
pub fn aria_details_elements(&self) -> std::option::Option<&str> {
self.sys.aria_details_elements.as_deref()
}
pub fn set_aria_details_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_details_elements = value.map(|v| v.into());
}
pub fn aria_disabled(&self) -> bool {
self.sys.aria_disabled
}
pub fn set_aria_disabled(&mut self, value: bool) {
self.sys.aria_disabled = value;
}
pub fn aria_drop_effect(&self) -> std::option::Option<&str> {
self.sys.aria_drop_effect.as_deref()
}
pub fn set_aria_drop_effect(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_drop_effect = value.map(|v| v.into());
}
pub fn aria_error_message_elements(&self) -> std::option::Option<&str> {
self.sys.aria_error_message_elements.as_deref()
}
pub fn set_aria_error_message_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_error_message_elements = value.map(|v| v.into());
}
pub fn aria_expanded(&self) -> bool {
self.sys.aria_expanded
}
pub fn set_aria_expanded(&mut self, value: bool) {
self.sys.aria_expanded = value;
}
pub fn aria_flow_to_elements(&self) -> std::option::Option<&str> {
self.sys.aria_flow_to_elements.as_deref()
}
pub fn set_aria_flow_to_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_flow_to_elements = value.map(|v| v.into());
}
pub fn aria_grabbed(&self) -> bool {
self.sys.aria_grabbed
}
pub fn set_aria_grabbed(&mut self, value: bool) {
self.sys.aria_grabbed = value;
}
pub fn aria_has_popup(&self) -> std::option::Option<&str> {
self.sys.aria_has_popup.as_deref()
}
pub fn set_aria_has_popup(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_has_popup = value.map(|v| v.into());
}
pub fn aria_hidden(&self) -> bool {
self.sys.aria_hidden
}
pub fn set_aria_hidden(&mut self, value: bool) {
self.sys.aria_hidden = value;
}
pub fn aria_invalid(&self) -> std::option::Option<&str> {
self.sys.aria_invalid.as_deref()
}
pub fn set_aria_invalid(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_invalid = value.map(|v| v.into());
}
pub fn aria_key_shortcuts(&self) -> std::option::Option<&str> {
self.sys.aria_key_shortcuts.as_deref()
}
pub fn set_aria_key_shortcuts(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_key_shortcuts = value.map(|v| v.into());
}
pub fn aria_label(&self) -> std::option::Option<&str> {
self.sys.aria_label.as_deref()
}
pub fn set_aria_label(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_label = value.map(|v| v.into());
}
pub fn aria_labelled_by_elements(&self) -> std::option::Option<&str> {
self.sys.aria_labelled_by_elements.as_deref()
}
pub fn set_aria_labelled_by_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_labelled_by_elements = value.map(|v| v.into());
}
pub fn aria_live(&self) -> std::option::Option<&str> {
self.sys.aria_live.as_deref()
}
pub fn set_aria_live(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_live = value.map(|v| v.into());
}
pub fn aria_multi_selectable(&self) -> bool {
self.sys.aria_multi_selectable
}
pub fn set_aria_multi_selectable(&mut self, value: bool) {
self.sys.aria_multi_selectable = value;
}
pub fn aria_orientation(&self) -> std::option::Option<&str> {
self.sys.aria_orientation.as_deref()
}
pub fn set_aria_orientation(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_orientation = value.map(|v| v.into());
}
pub fn aria_owns_elements(&self) -> std::option::Option<&str> {
self.sys.aria_owns_elements.as_deref()
}
pub fn set_aria_owns_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_owns_elements = value.map(|v| v.into());
}
pub fn aria_read_only(&self) -> bool {
self.sys.aria_read_only
}
pub fn set_aria_read_only(&mut self, value: bool) {
self.sys.aria_read_only = value;
}
pub fn aria_relevant(&self) -> std::option::Option<&str> {
self.sys.aria_relevant.as_deref()
}
pub fn set_aria_relevant(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_relevant = value.map(|v| v.into());
}
pub fn aria_required(&self) -> bool {
self.sys.aria_required
}
pub fn set_aria_required(&mut self, value: bool) {
self.sys.aria_required = value;
}
pub fn aria_role_description(&self) -> std::option::Option<&str> {
self.sys.aria_role_description.as_deref()
}
pub fn set_aria_role_description(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_role_description = value.map(|v| v.into());
}
pub fn access_key(&self) -> std::option::Option<&str> {
self.sys.access_key.as_deref()
}
pub fn set_access_key(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.access_key = value.map(|v| v.into());
}
pub fn auto_capitalize(&self) -> std::option::Option<&str> {
self.sys.auto_capitalize.as_deref()
}
pub fn set_auto_capitalize(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.auto_capitalize = value.map(|v| v.into());
}
pub fn autofocus(&self) -> bool {
self.sys.autofocus
}
pub fn set_autofocus(&mut self, value: bool) {
self.sys.autofocus = value;
}
pub fn class(&self) -> std::option::Option<&str> {
self.sys.class.as_deref()
}
pub fn set_class(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.class = value.map(|v| v.into());
}
pub fn content_editable(&self) -> std::option::Option<&str> {
self.sys.content_editable.as_deref()
}
pub fn set_content_editable(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.content_editable = value.map(|v| v.into());
}
pub fn direction(&self) -> std::option::Option<&str> {
self.sys.direction.as_deref()
}
pub fn set_direction(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.direction = value.map(|v| v.into());
}
pub fn draggable(&self) -> bool {
self.sys.draggable
}
pub fn set_draggable(&mut self, value: bool) {
self.sys.draggable = value;
}
pub fn enter_key_hint(&self) -> std::option::Option<&str> {
self.sys.enter_key_hint.as_deref()
}
pub fn set_enter_key_hint(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.enter_key_hint = value.map(|v| v.into());
}
pub fn export_parts(&self) -> std::option::Option<&str> {
self.sys.export_parts.as_deref()
}
pub fn set_export_parts(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.export_parts = value.map(|v| v.into());
}
pub fn hidden(&self) -> std::option::Option<&str> {
self.sys.hidden.as_deref()
}
pub fn set_hidden(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.hidden = value.map(|v| v.into());
}
pub fn id(&self) -> std::option::Option<&str> {
self.sys.id.as_deref()
}
pub fn set_id(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.id = value.map(|v| v.into());
}
pub fn inert(&self) -> bool {
self.sys.inert
}
pub fn set_inert(&mut self, value: bool) {
self.sys.inert = value;
}
pub fn input_mode(&self) -> std::option::Option<&str> {
self.sys.input_mode.as_deref()
}
pub fn set_input_mode(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.input_mode = value.map(|v| v.into());
}
pub fn is_(&self) -> std::option::Option<&str> {
self.sys.is_.as_deref()
}
pub fn set_is_(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.is_ = value.map(|v| v.into());
}
pub fn item_id(&self) -> std::option::Option<&str> {
self.sys.item_id.as_deref()
}
pub fn set_item_id(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_id = value.map(|v| v.into());
}
pub fn item_prop(&self) -> std::option::Option<&str> {
self.sys.item_prop.as_deref()
}
pub fn set_item_prop(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_prop = value.map(|v| v.into());
}
pub fn item_ref(&self) -> std::option::Option<&str> {
self.sys.item_ref.as_deref()
}
pub fn set_item_ref(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_ref = value.map(|v| v.into());
}
pub fn item_scope(&self) -> std::option::Option<&str> {
self.sys.item_scope.as_deref()
}
pub fn set_item_scope(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_scope = value.map(|v| v.into());
}
pub fn item_type(&self) -> std::option::Option<&str> {
self.sys.item_type.as_deref()
}
pub fn set_item_type(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_type = value.map(|v| v.into());
}
pub fn lang(&self) -> std::option::Option<&str> {
self.sys.lang.as_deref()
}
pub fn set_lang(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.lang = value.map(|v| v.into());
}
pub fn nonce(&self) -> std::option::Option<&str> {
self.sys.nonce.as_deref()
}
pub fn set_nonce(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.nonce = value.map(|v| v.into());
}
pub fn part(&self) -> std::option::Option<&str> {
self.sys.part.as_deref()
}
pub fn set_part(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.part = value.map(|v| v.into());
}
pub fn slot(&self) -> std::option::Option<&str> {
self.sys.slot.as_deref()
}
pub fn set_slot(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.slot = value.map(|v| v.into());
}
pub fn spellcheck(&self) -> std::option::Option<&str> {
self.sys.spellcheck.as_deref()
}
pub fn set_spellcheck(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.spellcheck = value.map(|v| v.into());
}
pub fn style(&self) -> std::option::Option<&str> {
self.sys.style.as_deref()
}
pub fn set_style(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.style = value.map(|v| v.into());
}
pub fn tab_index(&self) -> std::option::Option<i64> {
self.sys.tab_index
}
pub fn set_tab_index(&mut self, value: std::option::Option<i64>) {
self.sys.tab_index = value;
}
pub fn title(&self) -> std::option::Option<&str> {
self.sys.title.as_deref()
}
pub fn set_title(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.title = value.map(|v| v.into());
}
pub fn translate(&self) -> bool {
self.sys.translate
}
pub fn set_translate(&mut self, value: bool) {
self.sys.translate = value;
}
}
impl Select {
pub fn children(&self) -> &[super::child::SelectChild] {
self.children.as_ref()
}
pub fn children_mut(&mut self) -> &mut Vec<super::child::SelectChild> {
&mut self.children
}
}
impl crate::Render for Select {
fn render(
&self,
f: &mut std::fmt::Formatter<'_>,
depth: usize,
) -> std::fmt::Result {
write!(f, "{:level$}", "", level = depth * 4)?;
html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
if !self.children.is_empty() {
write!(f, "\n")?;
}
for el in &self.children {
crate::Render::render(&el, f, depth)?;
write!(f, "\n")?;
}
write!(f, "{:level$}", "", level = depth * 4)?;
html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
Ok(())
}
}
impl std::fmt::Debug for Select {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
crate::Render::render(self, f, 0)?;
Ok(())
}
}
impl std::fmt::Display for Select {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
for el in &self.children {
write!(f, "{el}")?;
}
html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
Ok(())
}
}
impl crate::HtmlElement for Select {}
impl crate::FlowContent for Select {}
impl crate::PhrasingContent for Select {}
impl crate::InteractiveContent for Select {}
impl crate::PalpableContent for Select {}
impl std::convert::Into<html_sys::forms::Select> for Select {
fn into(self) -> html_sys::forms::Select {
self.sys
}
}
impl From<html_sys::forms::Select> for Select {
fn from(sys: html_sys::forms::Select) -> Self {
Self { sys, children: vec![] }
}
}
}
pub mod child {
#[derive(PartialEq, Clone)]
pub enum SelectChild {
Option(crate::generated::all::Option),
OptionGroup(crate::generated::all::OptionGroup),
Script(crate::generated::all::Script),
Template(crate::generated::all::Template),
ThematicBreak(crate::generated::all::ThematicBreak),
}
impl std::convert::From<crate::generated::all::Option> for SelectChild {
fn from(value: crate::generated::all::Option) -> Self {
Self::Option(value)
}
}
impl std::convert::From<crate::generated::all::OptionGroup> for SelectChild {
fn from(value: crate::generated::all::OptionGroup) -> Self {
Self::OptionGroup(value)
}
}
impl std::convert::From<crate::generated::all::Script> for SelectChild {
fn from(value: crate::generated::all::Script) -> Self {
Self::Script(value)
}
}
impl std::convert::From<crate::generated::all::Template> for SelectChild {
fn from(value: crate::generated::all::Template) -> Self {
Self::Template(value)
}
}
impl std::convert::From<crate::generated::all::ThematicBreak> for SelectChild {
fn from(value: crate::generated::all::ThematicBreak) -> Self {
Self::ThematicBreak(value)
}
}
impl crate::Render for SelectChild {
fn render(
&self,
f: &mut std::fmt::Formatter<'_>,
depth: usize,
) -> std::fmt::Result {
match self {
Self::Option(el) => crate::Render::render(el, f, depth + 1),
Self::OptionGroup(el) => crate::Render::render(el, f, depth + 1),
Self::Script(el) => crate::Render::render(el, f, depth + 1),
Self::Template(el) => crate::Render::render(el, f, depth + 1),
Self::ThematicBreak(el) => crate::Render::render(el, f, depth + 1),
}
}
}
impl std::fmt::Debug for SelectChild {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
crate::Render::render(self, f, 0)?;
Ok(())
}
}
impl std::fmt::Display for SelectChild {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Option(el) => write!(f, "{el}"),
Self::OptionGroup(el) => write!(f, "{el}"),
Self::Script(el) => write!(f, "{el}"),
Self::Template(el) => write!(f, "{el}"),
Self::ThematicBreak(el) => write!(f, "{el}"),
}
}
}
}
pub mod builder {
pub struct SelectBuilder {
element: super::element::Select,
}
impl SelectBuilder {
pub(crate) fn new(element: super::element::Select) -> Self {
Self { element }
}
pub fn build(&mut self) -> super::element::Select {
self.element.clone()
}
pub fn data(
&mut self,
data_key: impl Into<std::borrow::Cow<'static, str>>,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut SelectBuilder {
self.element.data_map_mut().insert(data_key.into(), value.into());
self
}
pub fn option<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::OptionBuilder,
) -> &'a mut crate::generated::all::builders::OptionBuilder,
{
let ty: crate::generated::all::Option = Default::default();
let mut ty_builder = crate::generated::all::builders::OptionBuilder::new(ty);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn option_group<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::OptionGroupBuilder,
) -> &'a mut crate::generated::all::builders::OptionGroupBuilder,
{
let ty: crate::generated::all::OptionGroup = Default::default();
let mut ty_builder = crate::generated::all::builders::OptionGroupBuilder::new(
ty,
);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn script<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::ScriptBuilder,
) -> &'a mut crate::generated::all::builders::ScriptBuilder,
{
let ty: crate::generated::all::Script = Default::default();
let mut ty_builder = crate::generated::all::builders::ScriptBuilder::new(ty);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn template<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::TemplateBuilder,
) -> &'a mut crate::generated::all::builders::TemplateBuilder,
{
let ty: crate::generated::all::Template = Default::default();
let mut ty_builder = crate::generated::all::builders::TemplateBuilder::new(
ty,
);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn thematic_break<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::ThematicBreakBuilder,
) -> &'a mut crate::generated::all::builders::ThematicBreakBuilder,
{
let ty: crate::generated::all::ThematicBreak = Default::default();
let mut ty_builder = crate::generated::all::builders::ThematicBreakBuilder::new(
ty,
);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn autocomplete(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_autocomplete(Some(value.into()));
self
}
pub fn disabled(&mut self, value: bool) -> &mut Self {
self.element.set_disabled(value);
self
}
pub fn form(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_form(Some(value.into()));
self
}
pub fn multiple(&mut self, value: bool) -> &mut Self {
self.element.set_multiple(value);
self
}
pub fn name(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_name(Some(value.into()));
self
}
pub fn required(&mut self, value: bool) -> &mut Self {
self.element.set_required(value);
self
}
pub fn size(&mut self, value: i64) -> &mut Self {
self.element.set_size(Some(value));
self
}
pub fn role(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_role(Some(value.into()));
self
}
pub fn aria_active_descendant_element(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_active_descendant_element(Some(value.into()));
self
}
pub fn aria_atomic(&mut self, value: bool) -> &mut Self {
self.element.set_aria_atomic(value);
self
}
pub fn aria_auto_complete(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_auto_complete(Some(value.into()));
self
}
pub fn aria_braille_label(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_braille_label(Some(value.into()));
self
}
pub fn aria_braille_role_description(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_braille_role_description(Some(value.into()));
self
}
pub fn aria_busy(&mut self, value: bool) -> &mut Self {
self.element.set_aria_busy(value);
self
}
pub fn aria_controls_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_controls_elements(Some(value.into()));
self
}
pub fn aria_current(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_current(Some(value.into()));
self
}
pub fn aria_described_by_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_described_by_elements(Some(value.into()));
self
}
pub fn aria_description(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_description(Some(value.into()));
self
}
pub fn aria_details_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_details_elements(Some(value.into()));
self
}
pub fn aria_disabled(&mut self, value: bool) -> &mut Self {
self.element.set_aria_disabled(value);
self
}
pub fn aria_drop_effect(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_drop_effect(Some(value.into()));
self
}
pub fn aria_error_message_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_error_message_elements(Some(value.into()));
self
}
pub fn aria_expanded(&mut self, value: bool) -> &mut Self {
self.element.set_aria_expanded(value);
self
}
pub fn aria_flow_to_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_flow_to_elements(Some(value.into()));
self
}
pub fn aria_grabbed(&mut self, value: bool) -> &mut Self {
self.element.set_aria_grabbed(value);
self
}
pub fn aria_has_popup(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_has_popup(Some(value.into()));
self
}
pub fn aria_hidden(&mut self, value: bool) -> &mut Self {
self.element.set_aria_hidden(value);
self
}
pub fn aria_invalid(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_invalid(Some(value.into()));
self
}
pub fn aria_key_shortcuts(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_key_shortcuts(Some(value.into()));
self
}
pub fn aria_label(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_label(Some(value.into()));
self
}
pub fn aria_labelled_by_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_labelled_by_elements(Some(value.into()));
self
}
pub fn aria_live(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_live(Some(value.into()));
self
}
pub fn aria_multi_selectable(&mut self, value: bool) -> &mut Self {
self.element.set_aria_multi_selectable(value);
self
}
pub fn aria_orientation(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_orientation(Some(value.into()));
self
}
pub fn aria_owns_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_owns_elements(Some(value.into()));
self
}
pub fn aria_read_only(&mut self, value: bool) -> &mut Self {
self.element.set_aria_read_only(value);
self
}
pub fn aria_relevant(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_relevant(Some(value.into()));
self
}
pub fn aria_required(&mut self, value: bool) -> &mut Self {
self.element.set_aria_required(value);
self
}
pub fn aria_role_description(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_role_description(Some(value.into()));
self
}
pub fn access_key(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_access_key(Some(value.into()));
self
}
pub fn auto_capitalize(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_auto_capitalize(Some(value.into()));
self
}
pub fn autofocus(&mut self, value: bool) -> &mut Self {
self.element.set_autofocus(value);
self
}
pub fn class(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_class(Some(value.into()));
self
}
pub fn content_editable(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_content_editable(Some(value.into()));
self
}
pub fn direction(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_direction(Some(value.into()));
self
}
pub fn draggable(&mut self, value: bool) -> &mut Self {
self.element.set_draggable(value);
self
}
pub fn enter_key_hint(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_enter_key_hint(Some(value.into()));
self
}
pub fn export_parts(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_export_parts(Some(value.into()));
self
}
pub fn hidden(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_hidden(Some(value.into()));
self
}
pub fn id(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_id(Some(value.into()));
self
}
pub fn inert(&mut self, value: bool) -> &mut Self {
self.element.set_inert(value);
self
}
pub fn input_mode(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_input_mode(Some(value.into()));
self
}
pub fn is_(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_is_(Some(value.into()));
self
}
pub fn item_id(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_id(Some(value.into()));
self
}
pub fn item_prop(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_prop(Some(value.into()));
self
}
pub fn item_ref(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_ref(Some(value.into()));
self
}
pub fn item_scope(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_scope(Some(value.into()));
self
}
pub fn item_type(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_type(Some(value.into()));
self
}
pub fn lang(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_lang(Some(value.into()));
self
}
pub fn nonce(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_nonce(Some(value.into()));
self
}
pub fn part(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_part(Some(value.into()));
self
}
pub fn slot(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_slot(Some(value.into()));
self
}
pub fn spellcheck(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_spellcheck(Some(value.into()));
self
}
pub fn style(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_style(Some(value.into()));
self
}
pub fn tab_index(&mut self, value: i64) -> &mut Self {
self.element.set_tab_index(Some(value));
self
}
pub fn title(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_title(Some(value.into()));
self
}
pub fn translate(&mut self, value: bool) -> &mut Self {
self.element.set_translate(value);
self
}
pub fn push<T>(&mut self, child_el: T) -> &mut Self
where
T: Into<crate::generated::all::children::SelectChild>,
{
let child_el = child_el.into();
self.element.children_mut().push(child_el);
self
}
pub fn extend<I, T>(&mut self, iter: I) -> &mut Self
where
I: IntoIterator<Item = T>,
T: Into<crate::generated::all::children::SelectChild>,
{
let iter = iter.into_iter().map(|child_el| child_el.into());
self.element.children_mut().extend(iter);
self
}
}
}