1pub mod element {
2 #[doc(alias = "script")]
6 #[non_exhaustive]
7 #[derive(PartialEq, Clone, Default)]
8 pub struct Script {
9 sys: html_sys::scripting::Script,
10 children: Vec<super::child::ScriptChild>,
11 }
12 impl Script {
13 pub fn builder() -> super::builder::ScriptBuilder {
15 super::builder::ScriptBuilder::new(Default::default())
16 }
17 }
18 impl Script {
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 Script {
29 pub fn src(&self) -> std::option::Option<&str> {
31 self.sys.src.as_deref()
32 }
33 pub fn set_src(
35 &mut self,
36 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
37 ) {
38 self.sys.src = value.map(|v| v.into());
39 }
40 pub fn type_(&self) -> std::option::Option<&str> {
42 self.sys.type_.as_deref()
43 }
44 pub fn set_type_(
46 &mut self,
47 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
48 ) {
49 self.sys.type_ = value.map(|v| v.into());
50 }
51 pub fn nomodule(&self) -> std::option::Option<&str> {
53 self.sys.nomodule.as_deref()
54 }
55 pub fn set_nomodule(
57 &mut self,
58 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
59 ) {
60 self.sys.nomodule = value.map(|v| v.into());
61 }
62 pub fn async_(&self) -> std::option::Option<&str> {
64 self.sys.async_.as_deref()
65 }
66 pub fn set_async_(
68 &mut self,
69 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
70 ) {
71 self.sys.async_ = value.map(|v| v.into());
72 }
73 pub fn defer(&self) -> std::option::Option<&str> {
75 self.sys.defer.as_deref()
76 }
77 pub fn set_defer(
79 &mut self,
80 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
81 ) {
82 self.sys.defer = value.map(|v| v.into());
83 }
84 pub fn crossorigin(&self) -> std::option::Option<&str> {
86 self.sys.crossorigin.as_deref()
87 }
88 pub fn set_crossorigin(
90 &mut self,
91 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
92 ) {
93 self.sys.crossorigin = value.map(|v| v.into());
94 }
95 pub fn integrity(&self) -> std::option::Option<&str> {
97 self.sys.integrity.as_deref()
98 }
99 pub fn set_integrity(
101 &mut self,
102 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
103 ) {
104 self.sys.integrity = value.map(|v| v.into());
105 }
106 pub fn referrerpolicy(&self) -> std::option::Option<&str> {
108 self.sys.referrerpolicy.as_deref()
109 }
110 pub fn set_referrerpolicy(
112 &mut self,
113 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
114 ) {
115 self.sys.referrerpolicy = value.map(|v| v.into());
116 }
117 pub fn blocking(&self) -> std::option::Option<&str> {
119 self.sys.blocking.as_deref()
120 }
121 pub fn set_blocking(
123 &mut self,
124 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
125 ) {
126 self.sys.blocking = value.map(|v| v.into());
127 }
128 pub fn fetchpriority(&self) -> std::option::Option<&str> {
130 self.sys.fetchpriority.as_deref()
131 }
132 pub fn set_fetchpriority(
134 &mut self,
135 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
136 ) {
137 self.sys.fetchpriority = value.map(|v| v.into());
138 }
139 pub fn access_key(&self) -> std::option::Option<&str> {
141 self.sys.access_key.as_deref()
142 }
143 pub fn set_access_key(
145 &mut self,
146 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
147 ) {
148 self.sys.access_key = value.map(|v| v.into());
149 }
150 pub fn auto_capitalize(&self) -> std::option::Option<&str> {
152 self.sys.auto_capitalize.as_deref()
153 }
154 pub fn set_auto_capitalize(
156 &mut self,
157 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
158 ) {
159 self.sys.auto_capitalize = value.map(|v| v.into());
160 }
161 pub fn autofocus(&self) -> bool {
163 self.sys.autofocus
164 }
165 pub fn set_autofocus(&mut self, value: bool) {
167 self.sys.autofocus = value;
168 }
169 pub fn class(&self) -> std::option::Option<&str> {
171 self.sys.class.as_deref()
172 }
173 pub fn set_class(
175 &mut self,
176 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
177 ) {
178 self.sys.class = value.map(|v| v.into());
179 }
180 pub fn content_editable(&self) -> std::option::Option<&str> {
182 self.sys.content_editable.as_deref()
183 }
184 pub fn set_content_editable(
186 &mut self,
187 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
188 ) {
189 self.sys.content_editable = value.map(|v| v.into());
190 }
191 pub fn direction(&self) -> std::option::Option<&str> {
193 self.sys.direction.as_deref()
194 }
195 pub fn set_direction(
197 &mut self,
198 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
199 ) {
200 self.sys.direction = value.map(|v| v.into());
201 }
202 pub fn draggable(&self) -> bool {
204 self.sys.draggable
205 }
206 pub fn set_draggable(&mut self, value: bool) {
208 self.sys.draggable = value;
209 }
210 pub fn enter_key_hint(&self) -> std::option::Option<&str> {
212 self.sys.enter_key_hint.as_deref()
213 }
214 pub fn set_enter_key_hint(
216 &mut self,
217 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
218 ) {
219 self.sys.enter_key_hint = value.map(|v| v.into());
220 }
221 pub fn export_parts(&self) -> std::option::Option<&str> {
223 self.sys.export_parts.as_deref()
224 }
225 pub fn set_export_parts(
227 &mut self,
228 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
229 ) {
230 self.sys.export_parts = value.map(|v| v.into());
231 }
232 pub fn hidden(&self) -> std::option::Option<&str> {
234 self.sys.hidden.as_deref()
235 }
236 pub fn set_hidden(
238 &mut self,
239 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
240 ) {
241 self.sys.hidden = value.map(|v| v.into());
242 }
243 pub fn id(&self) -> std::option::Option<&str> {
245 self.sys.id.as_deref()
246 }
247 pub fn set_id(
249 &mut self,
250 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
251 ) {
252 self.sys.id = value.map(|v| v.into());
253 }
254 pub fn inert(&self) -> bool {
256 self.sys.inert
257 }
258 pub fn set_inert(&mut self, value: bool) {
260 self.sys.inert = value;
261 }
262 pub fn input_mode(&self) -> std::option::Option<&str> {
264 self.sys.input_mode.as_deref()
265 }
266 pub fn set_input_mode(
268 &mut self,
269 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
270 ) {
271 self.sys.input_mode = value.map(|v| v.into());
272 }
273 pub fn is_(&self) -> std::option::Option<&str> {
275 self.sys.is_.as_deref()
276 }
277 pub fn set_is_(
279 &mut self,
280 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
281 ) {
282 self.sys.is_ = value.map(|v| v.into());
283 }
284 pub fn item_id(&self) -> std::option::Option<&str> {
286 self.sys.item_id.as_deref()
287 }
288 pub fn set_item_id(
290 &mut self,
291 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
292 ) {
293 self.sys.item_id = value.map(|v| v.into());
294 }
295 pub fn item_prop(&self) -> std::option::Option<&str> {
297 self.sys.item_prop.as_deref()
298 }
299 pub fn set_item_prop(
301 &mut self,
302 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
303 ) {
304 self.sys.item_prop = value.map(|v| v.into());
305 }
306 pub fn item_ref(&self) -> std::option::Option<&str> {
308 self.sys.item_ref.as_deref()
309 }
310 pub fn set_item_ref(
312 &mut self,
313 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
314 ) {
315 self.sys.item_ref = value.map(|v| v.into());
316 }
317 pub fn item_scope(&self) -> std::option::Option<&str> {
319 self.sys.item_scope.as_deref()
320 }
321 pub fn set_item_scope(
323 &mut self,
324 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
325 ) {
326 self.sys.item_scope = value.map(|v| v.into());
327 }
328 pub fn item_type(&self) -> std::option::Option<&str> {
330 self.sys.item_type.as_deref()
331 }
332 pub fn set_item_type(
334 &mut self,
335 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
336 ) {
337 self.sys.item_type = value.map(|v| v.into());
338 }
339 pub fn lang(&self) -> std::option::Option<&str> {
341 self.sys.lang.as_deref()
342 }
343 pub fn set_lang(
345 &mut self,
346 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
347 ) {
348 self.sys.lang = value.map(|v| v.into());
349 }
350 pub fn nonce(&self) -> std::option::Option<&str> {
352 self.sys.nonce.as_deref()
353 }
354 pub fn set_nonce(
356 &mut self,
357 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
358 ) {
359 self.sys.nonce = value.map(|v| v.into());
360 }
361 pub fn part(&self) -> std::option::Option<&str> {
363 self.sys.part.as_deref()
364 }
365 pub fn set_part(
367 &mut self,
368 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
369 ) {
370 self.sys.part = value.map(|v| v.into());
371 }
372 pub fn slot(&self) -> std::option::Option<&str> {
374 self.sys.slot.as_deref()
375 }
376 pub fn set_slot(
378 &mut self,
379 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
380 ) {
381 self.sys.slot = value.map(|v| v.into());
382 }
383 pub fn spellcheck(&self) -> std::option::Option<&str> {
385 self.sys.spellcheck.as_deref()
386 }
387 pub fn set_spellcheck(
389 &mut self,
390 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
391 ) {
392 self.sys.spellcheck = value.map(|v| v.into());
393 }
394 pub fn style(&self) -> std::option::Option<&str> {
396 self.sys.style.as_deref()
397 }
398 pub fn set_style(
400 &mut self,
401 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
402 ) {
403 self.sys.style = value.map(|v| v.into());
404 }
405 pub fn tab_index(&self) -> std::option::Option<i64> {
407 self.sys.tab_index
408 }
409 pub fn set_tab_index(&mut self, value: std::option::Option<i64>) {
411 self.sys.tab_index = value;
412 }
413 pub fn title(&self) -> std::option::Option<&str> {
415 self.sys.title.as_deref()
416 }
417 pub fn set_title(
419 &mut self,
420 value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
421 ) {
422 self.sys.title = value.map(|v| v.into());
423 }
424 pub fn translate(&self) -> bool {
426 self.sys.translate
427 }
428 pub fn set_translate(&mut self, value: bool) {
430 self.sys.translate = value;
431 }
432 }
433 impl Script {
434 pub fn children(&self) -> &[super::child::ScriptChild] {
436 self.children.as_ref()
437 }
438 pub fn children_mut(&mut self) -> &mut Vec<super::child::ScriptChild> {
440 &mut self.children
441 }
442 }
443 impl crate::Render for Script {
444 fn render(
445 &self,
446 f: &mut std::fmt::Formatter<'_>,
447 depth: usize,
448 ) -> std::fmt::Result {
449 write!(f, "{:level$}", "", level = depth * 4)?;
450 html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
451 if !self.children.is_empty() {
452 write!(f, "\n")?;
453 }
454 for el in &self.children {
455 crate::Render::render(&el, f, depth)?;
456 write!(f, "\n")?;
457 }
458 write!(f, "{:level$}", "", level = depth * 4)?;
459 html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
460 Ok(())
461 }
462 }
463 impl std::fmt::Debug for Script {
464 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
465 crate::Render::render(self, f, 0)?;
466 Ok(())
467 }
468 }
469 impl std::fmt::Display for Script {
470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
471 html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
472 for el in &self.children {
473 write!(f, "{el}")?;
474 }
475 html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
476 Ok(())
477 }
478 }
479 impl crate::HtmlElement for Script {}
480 impl crate::MetadataContent for Script {}
481 impl crate::FlowContent for Script {}
482 impl crate::PhrasingContent for Script {}
483 impl crate::ScriptSupportingContent for Script {}
484 impl std::convert::Into<html_sys::scripting::Script> for Script {
485 fn into(self) -> html_sys::scripting::Script {
486 self.sys
487 }
488 }
489 impl From<html_sys::scripting::Script> for Script {
490 fn from(sys: html_sys::scripting::Script) -> Self {
491 Self { sys, children: vec![] }
492 }
493 }
494}
495pub mod child {
496 #[derive(PartialEq, Clone)]
498 pub enum ScriptChild {
499 Text(std::borrow::Cow<'static, str>),
501 }
502 impl std::convert::From<std::borrow::Cow<'static, str>> for ScriptChild {
503 fn from(value: std::borrow::Cow<'static, str>) -> Self {
504 Self::Text(value)
505 }
506 }
507 impl std::convert::From<&'static str> for ScriptChild {
508 fn from(value: &'static str) -> Self {
509 Self::Text(value.into())
510 }
511 }
512 impl std::convert::From<String> for ScriptChild {
513 fn from(value: String) -> Self {
514 Self::Text(value.into())
515 }
516 }
517 impl crate::Render for ScriptChild {
518 fn render(
519 &self,
520 f: &mut std::fmt::Formatter<'_>,
521 depth: usize,
522 ) -> std::fmt::Result {
523 match self {
524 Self::Text(el) => crate::Render::render(el, f, depth + 1),
525 }
526 }
527 }
528 impl std::fmt::Debug for ScriptChild {
529 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
530 crate::Render::render(self, f, 0)?;
531 Ok(())
532 }
533 }
534 impl std::fmt::Display for ScriptChild {
535 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
536 match self {
537 Self::Text(el) => write!(f, "{el}"),
538 }
539 }
540 }
541}
542pub mod builder {
543 pub struct ScriptBuilder {
545 element: super::element::Script,
546 }
547 impl ScriptBuilder {
548 pub(crate) fn new(element: super::element::Script) -> Self {
549 Self { element }
550 }
551 pub fn build(&mut self) -> super::element::Script {
553 self.element.clone()
554 }
555 pub fn data(
557 &mut self,
558 data_key: impl Into<std::borrow::Cow<'static, str>>,
559 value: impl Into<std::borrow::Cow<'static, str>>,
560 ) -> &mut ScriptBuilder {
561 self.element.data_map_mut().insert(data_key.into(), value.into());
562 self
563 }
564 pub fn text(
566 &mut self,
567 s: impl Into<std::borrow::Cow<'static, str>>,
568 ) -> &mut Self {
569 let cow = s.into();
570 self.element.children_mut().push(cow.into());
571 self
572 }
573 pub fn src(
575 &mut self,
576 value: impl Into<std::borrow::Cow<'static, str>>,
577 ) -> &mut Self {
578 self.element.set_src(Some(value.into()));
579 self
580 }
581 pub fn type_(
583 &mut self,
584 value: impl Into<std::borrow::Cow<'static, str>>,
585 ) -> &mut Self {
586 self.element.set_type_(Some(value.into()));
587 self
588 }
589 pub fn nomodule(
591 &mut self,
592 value: impl Into<std::borrow::Cow<'static, str>>,
593 ) -> &mut Self {
594 self.element.set_nomodule(Some(value.into()));
595 self
596 }
597 pub fn async_(
599 &mut self,
600 value: impl Into<std::borrow::Cow<'static, str>>,
601 ) -> &mut Self {
602 self.element.set_async_(Some(value.into()));
603 self
604 }
605 pub fn defer(
607 &mut self,
608 value: impl Into<std::borrow::Cow<'static, str>>,
609 ) -> &mut Self {
610 self.element.set_defer(Some(value.into()));
611 self
612 }
613 pub fn crossorigin(
615 &mut self,
616 value: impl Into<std::borrow::Cow<'static, str>>,
617 ) -> &mut Self {
618 self.element.set_crossorigin(Some(value.into()));
619 self
620 }
621 pub fn integrity(
623 &mut self,
624 value: impl Into<std::borrow::Cow<'static, str>>,
625 ) -> &mut Self {
626 self.element.set_integrity(Some(value.into()));
627 self
628 }
629 pub fn referrerpolicy(
631 &mut self,
632 value: impl Into<std::borrow::Cow<'static, str>>,
633 ) -> &mut Self {
634 self.element.set_referrerpolicy(Some(value.into()));
635 self
636 }
637 pub fn blocking(
639 &mut self,
640 value: impl Into<std::borrow::Cow<'static, str>>,
641 ) -> &mut Self {
642 self.element.set_blocking(Some(value.into()));
643 self
644 }
645 pub fn fetchpriority(
647 &mut self,
648 value: impl Into<std::borrow::Cow<'static, str>>,
649 ) -> &mut Self {
650 self.element.set_fetchpriority(Some(value.into()));
651 self
652 }
653 pub fn access_key(
655 &mut self,
656 value: impl Into<std::borrow::Cow<'static, str>>,
657 ) -> &mut Self {
658 self.element.set_access_key(Some(value.into()));
659 self
660 }
661 pub fn auto_capitalize(
663 &mut self,
664 value: impl Into<std::borrow::Cow<'static, str>>,
665 ) -> &mut Self {
666 self.element.set_auto_capitalize(Some(value.into()));
667 self
668 }
669 pub fn autofocus(&mut self, value: bool) -> &mut Self {
671 self.element.set_autofocus(value);
672 self
673 }
674 pub fn class(
676 &mut self,
677 value: impl Into<std::borrow::Cow<'static, str>>,
678 ) -> &mut Self {
679 self.element.set_class(Some(value.into()));
680 self
681 }
682 pub fn content_editable(
684 &mut self,
685 value: impl Into<std::borrow::Cow<'static, str>>,
686 ) -> &mut Self {
687 self.element.set_content_editable(Some(value.into()));
688 self
689 }
690 pub fn direction(
692 &mut self,
693 value: impl Into<std::borrow::Cow<'static, str>>,
694 ) -> &mut Self {
695 self.element.set_direction(Some(value.into()));
696 self
697 }
698 pub fn draggable(&mut self, value: bool) -> &mut Self {
700 self.element.set_draggable(value);
701 self
702 }
703 pub fn enter_key_hint(
705 &mut self,
706 value: impl Into<std::borrow::Cow<'static, str>>,
707 ) -> &mut Self {
708 self.element.set_enter_key_hint(Some(value.into()));
709 self
710 }
711 pub fn export_parts(
713 &mut self,
714 value: impl Into<std::borrow::Cow<'static, str>>,
715 ) -> &mut Self {
716 self.element.set_export_parts(Some(value.into()));
717 self
718 }
719 pub fn hidden(
721 &mut self,
722 value: impl Into<std::borrow::Cow<'static, str>>,
723 ) -> &mut Self {
724 self.element.set_hidden(Some(value.into()));
725 self
726 }
727 pub fn id(
729 &mut self,
730 value: impl Into<std::borrow::Cow<'static, str>>,
731 ) -> &mut Self {
732 self.element.set_id(Some(value.into()));
733 self
734 }
735 pub fn inert(&mut self, value: bool) -> &mut Self {
737 self.element.set_inert(value);
738 self
739 }
740 pub fn input_mode(
742 &mut self,
743 value: impl Into<std::borrow::Cow<'static, str>>,
744 ) -> &mut Self {
745 self.element.set_input_mode(Some(value.into()));
746 self
747 }
748 pub fn is_(
750 &mut self,
751 value: impl Into<std::borrow::Cow<'static, str>>,
752 ) -> &mut Self {
753 self.element.set_is_(Some(value.into()));
754 self
755 }
756 pub fn item_id(
758 &mut self,
759 value: impl Into<std::borrow::Cow<'static, str>>,
760 ) -> &mut Self {
761 self.element.set_item_id(Some(value.into()));
762 self
763 }
764 pub fn item_prop(
766 &mut self,
767 value: impl Into<std::borrow::Cow<'static, str>>,
768 ) -> &mut Self {
769 self.element.set_item_prop(Some(value.into()));
770 self
771 }
772 pub fn item_ref(
774 &mut self,
775 value: impl Into<std::borrow::Cow<'static, str>>,
776 ) -> &mut Self {
777 self.element.set_item_ref(Some(value.into()));
778 self
779 }
780 pub fn item_scope(
782 &mut self,
783 value: impl Into<std::borrow::Cow<'static, str>>,
784 ) -> &mut Self {
785 self.element.set_item_scope(Some(value.into()));
786 self
787 }
788 pub fn item_type(
790 &mut self,
791 value: impl Into<std::borrow::Cow<'static, str>>,
792 ) -> &mut Self {
793 self.element.set_item_type(Some(value.into()));
794 self
795 }
796 pub fn lang(
798 &mut self,
799 value: impl Into<std::borrow::Cow<'static, str>>,
800 ) -> &mut Self {
801 self.element.set_lang(Some(value.into()));
802 self
803 }
804 pub fn nonce(
806 &mut self,
807 value: impl Into<std::borrow::Cow<'static, str>>,
808 ) -> &mut Self {
809 self.element.set_nonce(Some(value.into()));
810 self
811 }
812 pub fn part(
814 &mut self,
815 value: impl Into<std::borrow::Cow<'static, str>>,
816 ) -> &mut Self {
817 self.element.set_part(Some(value.into()));
818 self
819 }
820 pub fn slot(
822 &mut self,
823 value: impl Into<std::borrow::Cow<'static, str>>,
824 ) -> &mut Self {
825 self.element.set_slot(Some(value.into()));
826 self
827 }
828 pub fn spellcheck(
830 &mut self,
831 value: impl Into<std::borrow::Cow<'static, str>>,
832 ) -> &mut Self {
833 self.element.set_spellcheck(Some(value.into()));
834 self
835 }
836 pub fn style(
838 &mut self,
839 value: impl Into<std::borrow::Cow<'static, str>>,
840 ) -> &mut Self {
841 self.element.set_style(Some(value.into()));
842 self
843 }
844 pub fn tab_index(&mut self, value: i64) -> &mut Self {
846 self.element.set_tab_index(Some(value));
847 self
848 }
849 pub fn title(
851 &mut self,
852 value: impl Into<std::borrow::Cow<'static, str>>,
853 ) -> &mut Self {
854 self.element.set_title(Some(value.into()));
855 self
856 }
857 pub fn translate(&mut self, value: bool) -> &mut Self {
859 self.element.set_translate(value);
860 self
861 }
862 pub fn push<T>(&mut self, child_el: T) -> &mut Self
864 where
865 T: Into<crate::generated::all::children::ScriptChild>,
866 {
867 let child_el = child_el.into();
868 self.element.children_mut().push(child_el);
869 self
870 }
871 pub fn extend<I, T>(&mut self, iter: I) -> &mut Self
873 where
874 I: IntoIterator<Item = T>,
875 T: Into<crate::generated::all::children::ScriptChild>,
876 {
877 let iter = iter.into_iter().map(|child_el| child_el.into());
878 self.element.children_mut().extend(iter);
879 self
880 }
881 }
882}