1pub mod element {
2 #[doc(alias = "head")]
6 #[non_exhaustive]
7 #[derive(PartialEq, Clone, Default)]
8 pub struct Head {
9 sys: html_sys::metadata::Head,
10 children: Vec<super::child::HeadChild>,
11 }
12 impl Head {
13 pub fn builder() -> super::builder::HeadBuilder {
15 super::builder::HeadBuilder::new(Default::default())
16 }
17 }
18 impl Head {
19 pub fn data_map(&self) -> &html_sys::DataMap {
21 &self.sys.data_map
22 }
23 pub fn data_map_mut(&mut self) -> &mut html_sys::DataMap {
25 &mut self.sys.data_map
26 }
27 }
28 impl Head {
29 pub fn access_key(&self) -> std::option::Option<&str> {
31 self.sys.access_key.as_deref()
32 }
33 pub fn set_access_key(
35 &mut self,
36 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
37 ) {
38 self.sys.access_key = value.map(|v| v.into());
39 }
40 pub fn auto_capitalize(&self) -> std::option::Option<&str> {
42 self.sys.auto_capitalize.as_deref()
43 }
44 pub fn set_auto_capitalize(
46 &mut self,
47 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
48 ) {
49 self.sys.auto_capitalize = value.map(|v| v.into());
50 }
51 pub fn autofocus(&self) -> bool {
53 self.sys.autofocus
54 }
55 pub fn set_autofocus(&mut self, value: bool) {
57 self.sys.autofocus = value;
58 }
59 pub fn class(&self) -> std::option::Option<&str> {
61 self.sys.class.as_deref()
62 }
63 pub fn set_class(
65 &mut self,
66 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
67 ) {
68 self.sys.class = value.map(|v| v.into());
69 }
70 pub fn content_editable(&self) -> std::option::Option<&str> {
72 self.sys.content_editable.as_deref()
73 }
74 pub fn set_content_editable(
76 &mut self,
77 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
78 ) {
79 self.sys.content_editable = value.map(|v| v.into());
80 }
81 pub fn direction(&self) -> std::option::Option<&str> {
83 self.sys.direction.as_deref()
84 }
85 pub fn set_direction(
87 &mut self,
88 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
89 ) {
90 self.sys.direction = value.map(|v| v.into());
91 }
92 pub fn draggable(&self) -> bool {
94 self.sys.draggable
95 }
96 pub fn set_draggable(&mut self, value: bool) {
98 self.sys.draggable = value;
99 }
100 pub fn enter_key_hint(&self) -> std::option::Option<&str> {
102 self.sys.enter_key_hint.as_deref()
103 }
104 pub fn set_enter_key_hint(
106 &mut self,
107 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
108 ) {
109 self.sys.enter_key_hint = value.map(|v| v.into());
110 }
111 pub fn export_parts(&self) -> std::option::Option<&str> {
113 self.sys.export_parts.as_deref()
114 }
115 pub fn set_export_parts(
117 &mut self,
118 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
119 ) {
120 self.sys.export_parts = value.map(|v| v.into());
121 }
122 pub fn hidden(&self) -> std::option::Option<&str> {
124 self.sys.hidden.as_deref()
125 }
126 pub fn set_hidden(
128 &mut self,
129 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
130 ) {
131 self.sys.hidden = value.map(|v| v.into());
132 }
133 pub fn id(&self) -> std::option::Option<&str> {
135 self.sys.id.as_deref()
136 }
137 pub fn set_id(
139 &mut self,
140 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
141 ) {
142 self.sys.id = value.map(|v| v.into());
143 }
144 pub fn inert(&self) -> bool {
146 self.sys.inert
147 }
148 pub fn set_inert(&mut self, value: bool) {
150 self.sys.inert = value;
151 }
152 pub fn input_mode(&self) -> std::option::Option<&str> {
154 self.sys.input_mode.as_deref()
155 }
156 pub fn set_input_mode(
158 &mut self,
159 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
160 ) {
161 self.sys.input_mode = value.map(|v| v.into());
162 }
163 pub fn is_(&self) -> std::option::Option<&str> {
165 self.sys.is_.as_deref()
166 }
167 pub fn set_is_(
169 &mut self,
170 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
171 ) {
172 self.sys.is_ = value.map(|v| v.into());
173 }
174 pub fn item_id(&self) -> std::option::Option<&str> {
176 self.sys.item_id.as_deref()
177 }
178 pub fn set_item_id(
180 &mut self,
181 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
182 ) {
183 self.sys.item_id = value.map(|v| v.into());
184 }
185 pub fn item_prop(&self) -> std::option::Option<&str> {
187 self.sys.item_prop.as_deref()
188 }
189 pub fn set_item_prop(
191 &mut self,
192 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
193 ) {
194 self.sys.item_prop = value.map(|v| v.into());
195 }
196 pub fn item_ref(&self) -> std::option::Option<&str> {
198 self.sys.item_ref.as_deref()
199 }
200 pub fn set_item_ref(
202 &mut self,
203 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
204 ) {
205 self.sys.item_ref = value.map(|v| v.into());
206 }
207 pub fn item_scope(&self) -> std::option::Option<&str> {
209 self.sys.item_scope.as_deref()
210 }
211 pub fn set_item_scope(
213 &mut self,
214 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
215 ) {
216 self.sys.item_scope = value.map(|v| v.into());
217 }
218 pub fn item_type(&self) -> std::option::Option<&str> {
220 self.sys.item_type.as_deref()
221 }
222 pub fn set_item_type(
224 &mut self,
225 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
226 ) {
227 self.sys.item_type = value.map(|v| v.into());
228 }
229 pub fn lang(&self) -> std::option::Option<&str> {
231 self.sys.lang.as_deref()
232 }
233 pub fn set_lang(
235 &mut self,
236 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
237 ) {
238 self.sys.lang = value.map(|v| v.into());
239 }
240 pub fn nonce(&self) -> std::option::Option<&str> {
242 self.sys.nonce.as_deref()
243 }
244 pub fn set_nonce(
246 &mut self,
247 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
248 ) {
249 self.sys.nonce = value.map(|v| v.into());
250 }
251 pub fn part(&self) -> std::option::Option<&str> {
253 self.sys.part.as_deref()
254 }
255 pub fn set_part(
257 &mut self,
258 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
259 ) {
260 self.sys.part = value.map(|v| v.into());
261 }
262 pub fn slot(&self) -> std::option::Option<&str> {
264 self.sys.slot.as_deref()
265 }
266 pub fn set_slot(
268 &mut self,
269 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
270 ) {
271 self.sys.slot = value.map(|v| v.into());
272 }
273 pub fn spellcheck(&self) -> std::option::Option<&str> {
275 self.sys.spellcheck.as_deref()
276 }
277 pub fn set_spellcheck(
279 &mut self,
280 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
281 ) {
282 self.sys.spellcheck = value.map(|v| v.into());
283 }
284 pub fn style(&self) -> std::option::Option<&str> {
286 self.sys.style.as_deref()
287 }
288 pub fn set_style(
290 &mut self,
291 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
292 ) {
293 self.sys.style = value.map(|v| v.into());
294 }
295 pub fn tab_index(&self) -> std::option::Option<i64> {
297 self.sys.tab_index
298 }
299 pub fn set_tab_index(&mut self, value: std::option::Option<i64>) {
301 self.sys.tab_index = value;
302 }
303 pub fn title(&self) -> std::option::Option<&str> {
305 self.sys.title.as_deref()
306 }
307 pub fn set_title(
309 &mut self,
310 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
311 ) {
312 self.sys.title = value.map(|v| v.into());
313 }
314 pub fn translate(&self) -> bool {
316 self.sys.translate
317 }
318 pub fn set_translate(&mut self, value: bool) {
320 self.sys.translate = value;
321 }
322 }
323 impl Head {
324 pub fn children(&self) -> &[super::child::HeadChild] {
326 self.children.as_ref()
327 }
328 pub fn children_mut(&mut self) -> &mut Vec<super::child::HeadChild> {
330 &mut self.children
331 }
332 }
333 impl crate::Render for Head {
334 fn render(
335 &self,
336 f: &mut std::fmt::Formatter<'_>,
337 depth: usize,
338 ) -> std::fmt::Result {
339 write!(f, "{:level$}", "", level = depth * 4)?;
340 html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
341 if !self.children.is_empty() {
342 write!(f, "\n")?;
343 }
344 for el in &self.children {
345 crate::Render::render(&el, f, depth)?;
346 write!(f, "\n")?;
347 }
348 write!(f, "{:level$}", "", level = depth * 4)?;
349 html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
350 Ok(())
351 }
352 }
353 impl std::fmt::Debug for Head {
354 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
355 crate::Render::render(self, f, 0)?;
356 Ok(())
357 }
358 }
359 impl std::fmt::Display for Head {
360 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
361 html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
362 for el in &self.children {
363 write!(f, "{el}")?;
364 }
365 html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
366 Ok(())
367 }
368 }
369 impl crate::HtmlElement for Head {}
370 impl std::convert::Into<html_sys::metadata::Head> for Head {
371 fn into(self) -> html_sys::metadata::Head {
372 self.sys
373 }
374 }
375 impl From<html_sys::metadata::Head> for Head {
376 fn from(sys: html_sys::metadata::Head) -> Self {
377 Self { sys, children: vec![] }
378 }
379 }
380}
381pub mod child {
382 #[derive(PartialEq, Clone)]
384 pub enum HeadChild {
385 Base(crate::generated::all::Base),
387 Link(crate::generated::all::Link),
389 Meta(crate::generated::all::Meta),
391 NoScript(crate::generated::all::NoScript),
393 Script(crate::generated::all::Script),
395 Style(crate::generated::all::Style),
397 Template(crate::generated::all::Template),
399 Title(crate::generated::all::Title),
401 }
402 impl std::convert::From<crate::generated::all::Base> for HeadChild {
403 fn from(value: crate::generated::all::Base) -> Self {
404 Self::Base(value)
405 }
406 }
407 impl std::convert::From<crate::generated::all::Link> for HeadChild {
408 fn from(value: crate::generated::all::Link) -> Self {
409 Self::Link(value)
410 }
411 }
412 impl std::convert::From<crate::generated::all::Meta> for HeadChild {
413 fn from(value: crate::generated::all::Meta) -> Self {
414 Self::Meta(value)
415 }
416 }
417 impl std::convert::From<crate::generated::all::NoScript> for HeadChild {
418 fn from(value: crate::generated::all::NoScript) -> Self {
419 Self::NoScript(value)
420 }
421 }
422 impl std::convert::From<crate::generated::all::Script> for HeadChild {
423 fn from(value: crate::generated::all::Script) -> Self {
424 Self::Script(value)
425 }
426 }
427 impl std::convert::From<crate::generated::all::Style> for HeadChild {
428 fn from(value: crate::generated::all::Style) -> Self {
429 Self::Style(value)
430 }
431 }
432 impl std::convert::From<crate::generated::all::Template> for HeadChild {
433 fn from(value: crate::generated::all::Template) -> Self {
434 Self::Template(value)
435 }
436 }
437 impl std::convert::From<crate::generated::all::Title> for HeadChild {
438 fn from(value: crate::generated::all::Title) -> Self {
439 Self::Title(value)
440 }
441 }
442 impl crate::Render for HeadChild {
443 fn render(
444 &self,
445 f: &mut std::fmt::Formatter<'_>,
446 depth: usize,
447 ) -> std::fmt::Result {
448 match self {
449 Self::Base(el) => crate::Render::render(el, f, depth + 1),
450 Self::Link(el) => crate::Render::render(el, f, depth + 1),
451 Self::Meta(el) => crate::Render::render(el, f, depth + 1),
452 Self::NoScript(el) => crate::Render::render(el, f, depth + 1),
453 Self::Script(el) => crate::Render::render(el, f, depth + 1),
454 Self::Style(el) => crate::Render::render(el, f, depth + 1),
455 Self::Template(el) => crate::Render::render(el, f, depth + 1),
456 Self::Title(el) => crate::Render::render(el, f, depth + 1),
457 }
458 }
459 }
460 impl std::fmt::Debug for HeadChild {
461 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
462 crate::Render::render(self, f, 0)?;
463 Ok(())
464 }
465 }
466 impl std::fmt::Display for HeadChild {
467 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
468 match self {
469 Self::Base(el) => write!(f, "{el}"),
470 Self::Link(el) => write!(f, "{el}"),
471 Self::Meta(el) => write!(f, "{el}"),
472 Self::NoScript(el) => write!(f, "{el}"),
473 Self::Script(el) => write!(f, "{el}"),
474 Self::Style(el) => write!(f, "{el}"),
475 Self::Template(el) => write!(f, "{el}"),
476 Self::Title(el) => write!(f, "{el}"),
477 }
478 }
479 }
480}
481pub mod builder {
482 pub struct HeadBuilder {
484 element: super::element::Head,
485 }
486 impl HeadBuilder {
487 pub(crate) fn new(element: super::element::Head) -> Self {
488 Self { element }
489 }
490 pub fn build(&mut self) -> super::element::Head {
492 self.element.clone()
493 }
494 pub fn data(
496 &mut self,
497 data_key: impl Into<std::borrow::Cow<'static, str>>,
498 value: impl Into<std::borrow::Cow<'static, str>>,
499 ) -> &mut HeadBuilder {
500 self.element.data_map_mut().insert(data_key.into(), value.into());
501 self
502 }
503 pub fn base<F>(&mut self, f: F) -> &mut Self
505 where
506 F: for<'a> FnOnce(
507 &'a mut crate::generated::all::builders::BaseBuilder,
508 ) -> &'a mut crate::generated::all::builders::BaseBuilder,
509 {
510 let ty: crate::generated::all::Base = Default::default();
511 let mut ty_builder = crate::generated::all::builders::BaseBuilder::new(ty);
512 (f)(&mut ty_builder);
513 let ty = ty_builder.build();
514 self.element.children_mut().push(ty.into());
515 self
516 }
517 pub fn link<F>(&mut self, f: F) -> &mut Self
519 where
520 F: for<'a> FnOnce(
521 &'a mut crate::generated::all::builders::LinkBuilder,
522 ) -> &'a mut crate::generated::all::builders::LinkBuilder,
523 {
524 let ty: crate::generated::all::Link = Default::default();
525 let mut ty_builder = crate::generated::all::builders::LinkBuilder::new(ty);
526 (f)(&mut ty_builder);
527 let ty = ty_builder.build();
528 self.element.children_mut().push(ty.into());
529 self
530 }
531 pub fn meta<F>(&mut self, f: F) -> &mut Self
533 where
534 F: for<'a> FnOnce(
535 &'a mut crate::generated::all::builders::MetaBuilder,
536 ) -> &'a mut crate::generated::all::builders::MetaBuilder,
537 {
538 let ty: crate::generated::all::Meta = Default::default();
539 let mut ty_builder = crate::generated::all::builders::MetaBuilder::new(ty);
540 (f)(&mut ty_builder);
541 let ty = ty_builder.build();
542 self.element.children_mut().push(ty.into());
543 self
544 }
545 pub fn no_script<F>(&mut self, f: F) -> &mut Self
547 where
548 F: for<'a> FnOnce(
549 &'a mut crate::generated::all::builders::NoScriptBuilder,
550 ) -> &'a mut crate::generated::all::builders::NoScriptBuilder,
551 {
552 let ty: crate::generated::all::NoScript = Default::default();
553 let mut ty_builder = crate::generated::all::builders::NoScriptBuilder::new(
554 ty,
555 );
556 (f)(&mut ty_builder);
557 let ty = ty_builder.build();
558 self.element.children_mut().push(ty.into());
559 self
560 }
561 pub fn script<F>(&mut self, f: F) -> &mut Self
563 where
564 F: for<'a> FnOnce(
565 &'a mut crate::generated::all::builders::ScriptBuilder,
566 ) -> &'a mut crate::generated::all::builders::ScriptBuilder,
567 {
568 let ty: crate::generated::all::Script = Default::default();
569 let mut ty_builder = crate::generated::all::builders::ScriptBuilder::new(ty);
570 (f)(&mut ty_builder);
571 let ty = ty_builder.build();
572 self.element.children_mut().push(ty.into());
573 self
574 }
575 pub fn style<F>(&mut self, f: F) -> &mut Self
577 where
578 F: for<'a> FnOnce(
579 &'a mut crate::generated::all::builders::StyleBuilder,
580 ) -> &'a mut crate::generated::all::builders::StyleBuilder,
581 {
582 let ty: crate::generated::all::Style = Default::default();
583 let mut ty_builder = crate::generated::all::builders::StyleBuilder::new(ty);
584 (f)(&mut ty_builder);
585 let ty = ty_builder.build();
586 self.element.children_mut().push(ty.into());
587 self
588 }
589 pub fn template<F>(&mut self, f: F) -> &mut Self
591 where
592 F: for<'a> FnOnce(
593 &'a mut crate::generated::all::builders::TemplateBuilder,
594 ) -> &'a mut crate::generated::all::builders::TemplateBuilder,
595 {
596 let ty: crate::generated::all::Template = Default::default();
597 let mut ty_builder = crate::generated::all::builders::TemplateBuilder::new(
598 ty,
599 );
600 (f)(&mut ty_builder);
601 let ty = ty_builder.build();
602 self.element.children_mut().push(ty.into());
603 self
604 }
605 pub fn title<F>(&mut self, f: F) -> &mut Self
607 where
608 F: for<'a> FnOnce(
609 &'a mut crate::generated::all::builders::TitleBuilder,
610 ) -> &'a mut crate::generated::all::builders::TitleBuilder,
611 {
612 let ty: crate::generated::all::Title = Default::default();
613 let mut ty_builder = crate::generated::all::builders::TitleBuilder::new(ty);
614 (f)(&mut ty_builder);
615 let ty = ty_builder.build();
616 self.element.children_mut().push(ty.into());
617 self
618 }
619 pub fn access_key(
621 &mut self,
622 value: impl Into<std::borrow::Cow<'static, str>>,
623 ) -> &mut Self {
624 self.element.set_access_key(Some(value.into()));
625 self
626 }
627 pub fn auto_capitalize(
629 &mut self,
630 value: impl Into<std::borrow::Cow<'static, str>>,
631 ) -> &mut Self {
632 self.element.set_auto_capitalize(Some(value.into()));
633 self
634 }
635 pub fn autofocus(&mut self, value: bool) -> &mut Self {
637 self.element.set_autofocus(value);
638 self
639 }
640 pub fn class(
642 &mut self,
643 value: impl Into<std::borrow::Cow<'static, str>>,
644 ) -> &mut Self {
645 self.element.set_class(Some(value.into()));
646 self
647 }
648 pub fn content_editable(
650 &mut self,
651 value: impl Into<std::borrow::Cow<'static, str>>,
652 ) -> &mut Self {
653 self.element.set_content_editable(Some(value.into()));
654 self
655 }
656 pub fn direction(
658 &mut self,
659 value: impl Into<std::borrow::Cow<'static, str>>,
660 ) -> &mut Self {
661 self.element.set_direction(Some(value.into()));
662 self
663 }
664 pub fn draggable(&mut self, value: bool) -> &mut Self {
666 self.element.set_draggable(value);
667 self
668 }
669 pub fn enter_key_hint(
671 &mut self,
672 value: impl Into<std::borrow::Cow<'static, str>>,
673 ) -> &mut Self {
674 self.element.set_enter_key_hint(Some(value.into()));
675 self
676 }
677 pub fn export_parts(
679 &mut self,
680 value: impl Into<std::borrow::Cow<'static, str>>,
681 ) -> &mut Self {
682 self.element.set_export_parts(Some(value.into()));
683 self
684 }
685 pub fn hidden(
687 &mut self,
688 value: impl Into<std::borrow::Cow<'static, str>>,
689 ) -> &mut Self {
690 self.element.set_hidden(Some(value.into()));
691 self
692 }
693 pub fn id(
695 &mut self,
696 value: impl Into<std::borrow::Cow<'static, str>>,
697 ) -> &mut Self {
698 self.element.set_id(Some(value.into()));
699 self
700 }
701 pub fn inert(&mut self, value: bool) -> &mut Self {
703 self.element.set_inert(value);
704 self
705 }
706 pub fn input_mode(
708 &mut self,
709 value: impl Into<std::borrow::Cow<'static, str>>,
710 ) -> &mut Self {
711 self.element.set_input_mode(Some(value.into()));
712 self
713 }
714 pub fn is_(
716 &mut self,
717 value: impl Into<std::borrow::Cow<'static, str>>,
718 ) -> &mut Self {
719 self.element.set_is_(Some(value.into()));
720 self
721 }
722 pub fn item_id(
724 &mut self,
725 value: impl Into<std::borrow::Cow<'static, str>>,
726 ) -> &mut Self {
727 self.element.set_item_id(Some(value.into()));
728 self
729 }
730 pub fn item_prop(
732 &mut self,
733 value: impl Into<std::borrow::Cow<'static, str>>,
734 ) -> &mut Self {
735 self.element.set_item_prop(Some(value.into()));
736 self
737 }
738 pub fn item_ref(
740 &mut self,
741 value: impl Into<std::borrow::Cow<'static, str>>,
742 ) -> &mut Self {
743 self.element.set_item_ref(Some(value.into()));
744 self
745 }
746 pub fn item_scope(
748 &mut self,
749 value: impl Into<std::borrow::Cow<'static, str>>,
750 ) -> &mut Self {
751 self.element.set_item_scope(Some(value.into()));
752 self
753 }
754 pub fn item_type(
756 &mut self,
757 value: impl Into<std::borrow::Cow<'static, str>>,
758 ) -> &mut Self {
759 self.element.set_item_type(Some(value.into()));
760 self
761 }
762 pub fn lang(
764 &mut self,
765 value: impl Into<std::borrow::Cow<'static, str>>,
766 ) -> &mut Self {
767 self.element.set_lang(Some(value.into()));
768 self
769 }
770 pub fn nonce(
772 &mut self,
773 value: impl Into<std::borrow::Cow<'static, str>>,
774 ) -> &mut Self {
775 self.element.set_nonce(Some(value.into()));
776 self
777 }
778 pub fn part(
780 &mut self,
781 value: impl Into<std::borrow::Cow<'static, str>>,
782 ) -> &mut Self {
783 self.element.set_part(Some(value.into()));
784 self
785 }
786 pub fn slot(
788 &mut self,
789 value: impl Into<std::borrow::Cow<'static, str>>,
790 ) -> &mut Self {
791 self.element.set_slot(Some(value.into()));
792 self
793 }
794 pub fn spellcheck(
796 &mut self,
797 value: impl Into<std::borrow::Cow<'static, str>>,
798 ) -> &mut Self {
799 self.element.set_spellcheck(Some(value.into()));
800 self
801 }
802 pub fn style_attr(
804 &mut self,
805 value: impl Into<std::borrow::Cow<'static, str>>,
806 ) -> &mut Self {
807 self.element.set_style(Some(value.into()));
808 self
809 }
810 pub fn tab_index(&mut self, value: i64) -> &mut Self {
812 self.element.set_tab_index(Some(value));
813 self
814 }
815 pub fn title_attr(
817 &mut self,
818 value: impl Into<std::borrow::Cow<'static, str>>,
819 ) -> &mut Self {
820 self.element.set_title(Some(value.into()));
821 self
822 }
823 pub fn translate(&mut self, value: bool) -> &mut Self {
825 self.element.set_translate(value);
826 self
827 }
828 pub fn push<T>(&mut self, child_el: T) -> &mut Self
830 where
831 T: Into<crate::generated::all::children::HeadChild>,
832 {
833 let child_el = child_el.into();
834 self.element.children_mut().push(child_el);
835 self
836 }
837 pub fn extend<I, T>(&mut self, iter: I) -> &mut Self
839 where
840 I: IntoIterator<Item = T>,
841 T: Into<crate::generated::all::children::HeadChild>,
842 {
843 let iter = iter.into_iter().map(|child_el| child_el.into());
844 self.element.children_mut().extend(iter);
845 self
846 }
847 }
848}