html/generated/
picture.rs

1pub mod element {
2    /// The HTML `<picture>` element
3    ///
4    /// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture)
5    #[doc(alias = "picture")]
6    #[non_exhaustive]
7    #[derive(PartialEq, Clone, Default)]
8    pub struct Picture {
9        sys: html_sys::embedded::Picture,
10        children: Vec<super::child::PictureChild>,
11    }
12    impl Picture {
13        /// Create a new builder
14        pub fn builder() -> super::builder::PictureBuilder {
15            super::builder::PictureBuilder::new(Default::default())
16        }
17    }
18    impl Picture {
19        /// Access the element's `data-*` properties
20        pub fn data_map(&self) -> &html_sys::DataMap {
21            &self.sys.data_map
22        }
23        /// Mutably access the element's `data-*` properties
24        pub fn data_map_mut(&mut self) -> &mut html_sys::DataMap {
25            &mut self.sys.data_map
26        }
27    }
28    impl Picture {
29        /// Get the value of the `aria-hidden` attribute
30        pub fn aria_hidden(&self) -> bool {
31            self.sys.aria_hidden
32        }
33        /// Set the value of the `aria-hidden` attribute
34        pub fn set_aria_hidden(&mut self, value: bool) {
35            self.sys.aria_hidden = value;
36        }
37        /// Get the value of the `accesskey` attribute
38        pub fn access_key(&self) -> std::option::Option<&str> {
39            self.sys.access_key.as_deref()
40        }
41        /// Set the value of the `accesskey` attribute
42        pub fn set_access_key(
43            &mut self,
44            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
45        ) {
46            self.sys.access_key = value.map(|v| v.into());
47        }
48        /// Get the value of the `autocapitalize` attribute
49        pub fn auto_capitalize(&self) -> std::option::Option<&str> {
50            self.sys.auto_capitalize.as_deref()
51        }
52        /// Set the value of the `autocapitalize` attribute
53        pub fn set_auto_capitalize(
54            &mut self,
55            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
56        ) {
57            self.sys.auto_capitalize = value.map(|v| v.into());
58        }
59        /// Get the value of the `autofocus` attribute
60        pub fn autofocus(&self) -> bool {
61            self.sys.autofocus
62        }
63        /// Set the value of the `autofocus` attribute
64        pub fn set_autofocus(&mut self, value: bool) {
65            self.sys.autofocus = value;
66        }
67        /// Get the value of the `class` attribute
68        pub fn class(&self) -> std::option::Option<&str> {
69            self.sys.class.as_deref()
70        }
71        /// Set the value of the `class` attribute
72        pub fn set_class(
73            &mut self,
74            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
75        ) {
76            self.sys.class = value.map(|v| v.into());
77        }
78        /// Get the value of the `contenteditable` attribute
79        pub fn content_editable(&self) -> std::option::Option<&str> {
80            self.sys.content_editable.as_deref()
81        }
82        /// Set the value of the `contenteditable` attribute
83        pub fn set_content_editable(
84            &mut self,
85            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
86        ) {
87            self.sys.content_editable = value.map(|v| v.into());
88        }
89        /// Get the value of the `dir` attribute
90        pub fn direction(&self) -> std::option::Option<&str> {
91            self.sys.direction.as_deref()
92        }
93        /// Set the value of the `dir` attribute
94        pub fn set_direction(
95            &mut self,
96            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
97        ) {
98            self.sys.direction = value.map(|v| v.into());
99        }
100        /// Get the value of the `draggable` attribute
101        pub fn draggable(&self) -> bool {
102            self.sys.draggable
103        }
104        /// Set the value of the `draggable` attribute
105        pub fn set_draggable(&mut self, value: bool) {
106            self.sys.draggable = value;
107        }
108        /// Get the value of the `enterkeyhint` attribute
109        pub fn enter_key_hint(&self) -> std::option::Option<&str> {
110            self.sys.enter_key_hint.as_deref()
111        }
112        /// Set the value of the `enterkeyhint` attribute
113        pub fn set_enter_key_hint(
114            &mut self,
115            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
116        ) {
117            self.sys.enter_key_hint = value.map(|v| v.into());
118        }
119        /// Get the value of the `exportparts` attribute
120        pub fn export_parts(&self) -> std::option::Option<&str> {
121            self.sys.export_parts.as_deref()
122        }
123        /// Set the value of the `exportparts` attribute
124        pub fn set_export_parts(
125            &mut self,
126            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
127        ) {
128            self.sys.export_parts = value.map(|v| v.into());
129        }
130        /// Get the value of the `hidden` attribute
131        pub fn hidden(&self) -> std::option::Option<&str> {
132            self.sys.hidden.as_deref()
133        }
134        /// Set the value of the `hidden` attribute
135        pub fn set_hidden(
136            &mut self,
137            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
138        ) {
139            self.sys.hidden = value.map(|v| v.into());
140        }
141        /// Get the value of the `id` attribute
142        pub fn id(&self) -> std::option::Option<&str> {
143            self.sys.id.as_deref()
144        }
145        /// Set the value of the `id` attribute
146        pub fn set_id(
147            &mut self,
148            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
149        ) {
150            self.sys.id = value.map(|v| v.into());
151        }
152        /// Get the value of the `inert` attribute
153        pub fn inert(&self) -> bool {
154            self.sys.inert
155        }
156        /// Set the value of the `inert` attribute
157        pub fn set_inert(&mut self, value: bool) {
158            self.sys.inert = value;
159        }
160        /// Get the value of the `inputmode` attribute
161        pub fn input_mode(&self) -> std::option::Option<&str> {
162            self.sys.input_mode.as_deref()
163        }
164        /// Set the value of the `inputmode` attribute
165        pub fn set_input_mode(
166            &mut self,
167            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
168        ) {
169            self.sys.input_mode = value.map(|v| v.into());
170        }
171        /// Get the value of the `is` attribute
172        pub fn is_(&self) -> std::option::Option<&str> {
173            self.sys.is_.as_deref()
174        }
175        /// Set the value of the `is` attribute
176        pub fn set_is_(
177            &mut self,
178            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
179        ) {
180            self.sys.is_ = value.map(|v| v.into());
181        }
182        /// Get the value of the `itemid` attribute
183        pub fn item_id(&self) -> std::option::Option<&str> {
184            self.sys.item_id.as_deref()
185        }
186        /// Set the value of the `itemid` attribute
187        pub fn set_item_id(
188            &mut self,
189            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
190        ) {
191            self.sys.item_id = value.map(|v| v.into());
192        }
193        /// Get the value of the `itemprop` attribute
194        pub fn item_prop(&self) -> std::option::Option<&str> {
195            self.sys.item_prop.as_deref()
196        }
197        /// Set the value of the `itemprop` attribute
198        pub fn set_item_prop(
199            &mut self,
200            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
201        ) {
202            self.sys.item_prop = value.map(|v| v.into());
203        }
204        /// Get the value of the `itemref` attribute
205        pub fn item_ref(&self) -> std::option::Option<&str> {
206            self.sys.item_ref.as_deref()
207        }
208        /// Set the value of the `itemref` attribute
209        pub fn set_item_ref(
210            &mut self,
211            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
212        ) {
213            self.sys.item_ref = value.map(|v| v.into());
214        }
215        /// Get the value of the `itemscope` attribute
216        pub fn item_scope(&self) -> std::option::Option<&str> {
217            self.sys.item_scope.as_deref()
218        }
219        /// Set the value of the `itemscope` attribute
220        pub fn set_item_scope(
221            &mut self,
222            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
223        ) {
224            self.sys.item_scope = value.map(|v| v.into());
225        }
226        /// Get the value of the `itemtype` attribute
227        pub fn item_type(&self) -> std::option::Option<&str> {
228            self.sys.item_type.as_deref()
229        }
230        /// Set the value of the `itemtype` attribute
231        pub fn set_item_type(
232            &mut self,
233            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
234        ) {
235            self.sys.item_type = value.map(|v| v.into());
236        }
237        /// Get the value of the `lang` attribute
238        pub fn lang(&self) -> std::option::Option<&str> {
239            self.sys.lang.as_deref()
240        }
241        /// Set the value of the `lang` attribute
242        pub fn set_lang(
243            &mut self,
244            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
245        ) {
246            self.sys.lang = value.map(|v| v.into());
247        }
248        /// Get the value of the `nonce` attribute
249        pub fn nonce(&self) -> std::option::Option<&str> {
250            self.sys.nonce.as_deref()
251        }
252        /// Set the value of the `nonce` attribute
253        pub fn set_nonce(
254            &mut self,
255            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
256        ) {
257            self.sys.nonce = value.map(|v| v.into());
258        }
259        /// Get the value of the `part` attribute
260        pub fn part(&self) -> std::option::Option<&str> {
261            self.sys.part.as_deref()
262        }
263        /// Set the value of the `part` attribute
264        pub fn set_part(
265            &mut self,
266            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
267        ) {
268            self.sys.part = value.map(|v| v.into());
269        }
270        /// Get the value of the `slot` attribute
271        pub fn slot(&self) -> std::option::Option<&str> {
272            self.sys.slot.as_deref()
273        }
274        /// Set the value of the `slot` attribute
275        pub fn set_slot(
276            &mut self,
277            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
278        ) {
279            self.sys.slot = value.map(|v| v.into());
280        }
281        /// Get the value of the `spellcheck` attribute
282        pub fn spellcheck(&self) -> std::option::Option<&str> {
283            self.sys.spellcheck.as_deref()
284        }
285        /// Set the value of the `spellcheck` attribute
286        pub fn set_spellcheck(
287            &mut self,
288            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
289        ) {
290            self.sys.spellcheck = value.map(|v| v.into());
291        }
292        /// Get the value of the `style` attribute
293        pub fn style(&self) -> std::option::Option<&str> {
294            self.sys.style.as_deref()
295        }
296        /// Set the value of the `style` attribute
297        pub fn set_style(
298            &mut self,
299            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
300        ) {
301            self.sys.style = value.map(|v| v.into());
302        }
303        /// Get the value of the `tabindex` attribute
304        pub fn tab_index(&self) -> std::option::Option<i64> {
305            self.sys.tab_index
306        }
307        /// Set the value of the `tabindex` attribute
308        pub fn set_tab_index(&mut self, value: std::option::Option<i64>) {
309            self.sys.tab_index = value;
310        }
311        /// Get the value of the `title` attribute
312        pub fn title(&self) -> std::option::Option<&str> {
313            self.sys.title.as_deref()
314        }
315        /// Set the value of the `title` attribute
316        pub fn set_title(
317            &mut self,
318            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
319        ) {
320            self.sys.title = value.map(|v| v.into());
321        }
322        /// Get the value of the `translate` attribute
323        pub fn translate(&self) -> bool {
324            self.sys.translate
325        }
326        /// Set the value of the `translate` attribute
327        pub fn set_translate(&mut self, value: bool) {
328            self.sys.translate = value;
329        }
330    }
331    impl Picture {
332        /// Access the element's children
333        pub fn children(&self) -> &[super::child::PictureChild] {
334            self.children.as_ref()
335        }
336        /// Mutably access the element's children
337        pub fn children_mut(&mut self) -> &mut Vec<super::child::PictureChild> {
338            &mut self.children
339        }
340    }
341    impl crate::Render for Picture {
342        fn render(
343            &self,
344            f: &mut std::fmt::Formatter<'_>,
345            depth: usize,
346        ) -> std::fmt::Result {
347            write!(f, "{:level$}", "", level = depth * 4)?;
348            html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
349            if !self.children.is_empty() {
350                write!(f, "\n")?;
351            }
352            for el in &self.children {
353                crate::Render::render(&el, f, depth)?;
354                write!(f, "\n")?;
355            }
356            write!(f, "{:level$}", "", level = depth * 4)?;
357            html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
358            Ok(())
359        }
360    }
361    impl std::fmt::Debug for Picture {
362        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
363            crate::Render::render(self, f, 0)?;
364            Ok(())
365        }
366    }
367    impl std::fmt::Display for Picture {
368        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
369            html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
370            for el in &self.children {
371                write!(f, "{el}")?;
372            }
373            html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
374            Ok(())
375        }
376    }
377    impl crate::HtmlElement for Picture {}
378    impl crate::FlowContent for Picture {}
379    impl crate::PhrasingContent for Picture {}
380    impl crate::EmbeddedContent for Picture {}
381    impl crate::PalpableContent for Picture {}
382    impl std::convert::Into<html_sys::embedded::Picture> for Picture {
383        fn into(self) -> html_sys::embedded::Picture {
384            self.sys
385        }
386    }
387    impl From<html_sys::embedded::Picture> for Picture {
388        fn from(sys: html_sys::embedded::Picture) -> Self {
389            Self { sys, children: vec![] }
390        }
391    }
392}
393pub mod child {
394    /// The permitted child items for the `Picture` element
395    #[derive(PartialEq, Clone)]
396    pub enum PictureChild {
397        /// The Image element
398        Image(crate::generated::all::Image),
399        /// The MediaSource element
400        MediaSource(crate::generated::all::MediaSource),
401        /// The Script element
402        Script(crate::generated::all::Script),
403        /// The Template element
404        Template(crate::generated::all::Template),
405    }
406    impl std::convert::From<crate::generated::all::Image> for PictureChild {
407        fn from(value: crate::generated::all::Image) -> Self {
408            Self::Image(value)
409        }
410    }
411    impl std::convert::From<crate::generated::all::MediaSource> for PictureChild {
412        fn from(value: crate::generated::all::MediaSource) -> Self {
413            Self::MediaSource(value)
414        }
415    }
416    impl std::convert::From<crate::generated::all::Script> for PictureChild {
417        fn from(value: crate::generated::all::Script) -> Self {
418            Self::Script(value)
419        }
420    }
421    impl std::convert::From<crate::generated::all::Template> for PictureChild {
422        fn from(value: crate::generated::all::Template) -> Self {
423            Self::Template(value)
424        }
425    }
426    impl crate::Render for PictureChild {
427        fn render(
428            &self,
429            f: &mut std::fmt::Formatter<'_>,
430            depth: usize,
431        ) -> std::fmt::Result {
432            match self {
433                Self::Image(el) => crate::Render::render(el, f, depth + 1),
434                Self::MediaSource(el) => crate::Render::render(el, f, depth + 1),
435                Self::Script(el) => crate::Render::render(el, f, depth + 1),
436                Self::Template(el) => crate::Render::render(el, f, depth + 1),
437            }
438        }
439    }
440    impl std::fmt::Debug for PictureChild {
441        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
442            crate::Render::render(self, f, 0)?;
443            Ok(())
444        }
445    }
446    impl std::fmt::Display for PictureChild {
447        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
448            match self {
449                Self::Image(el) => write!(f, "{el}"),
450                Self::MediaSource(el) => write!(f, "{el}"),
451                Self::Script(el) => write!(f, "{el}"),
452                Self::Template(el) => write!(f, "{el}"),
453            }
454        }
455    }
456}
457pub mod builder {
458    /// A builder struct for Picture
459    pub struct PictureBuilder {
460        element: super::element::Picture,
461    }
462    impl PictureBuilder {
463        pub(crate) fn new(element: super::element::Picture) -> Self {
464            Self { element }
465        }
466        /// Finish building the element
467        pub fn build(&mut self) -> super::element::Picture {
468            self.element.clone()
469        }
470        /// Insert a `data-*` property
471        pub fn data(
472            &mut self,
473            data_key: impl Into<std::borrow::Cow<'static, str>>,
474            value: impl Into<std::borrow::Cow<'static, str>>,
475        ) -> &mut PictureBuilder {
476            self.element.data_map_mut().insert(data_key.into(), value.into());
477            self
478        }
479        /// Append a new `Image` element
480        pub fn image<F>(&mut self, f: F) -> &mut Self
481        where
482            F: for<'a> FnOnce(
483                &'a mut crate::generated::all::builders::ImageBuilder,
484            ) -> &'a mut crate::generated::all::builders::ImageBuilder,
485        {
486            let ty: crate::generated::all::Image = Default::default();
487            let mut ty_builder = crate::generated::all::builders::ImageBuilder::new(ty);
488            (f)(&mut ty_builder);
489            let ty = ty_builder.build();
490            self.element.children_mut().push(ty.into());
491            self
492        }
493        /// Append a new `MediaSource` element
494        pub fn media_source<F>(&mut self, f: F) -> &mut Self
495        where
496            F: for<'a> FnOnce(
497                &'a mut crate::generated::all::builders::MediaSourceBuilder,
498            ) -> &'a mut crate::generated::all::builders::MediaSourceBuilder,
499        {
500            let ty: crate::generated::all::MediaSource = Default::default();
501            let mut ty_builder = crate::generated::all::builders::MediaSourceBuilder::new(
502                ty,
503            );
504            (f)(&mut ty_builder);
505            let ty = ty_builder.build();
506            self.element.children_mut().push(ty.into());
507            self
508        }
509        /// Append a new `Script` element
510        pub fn script<F>(&mut self, f: F) -> &mut Self
511        where
512            F: for<'a> FnOnce(
513                &'a mut crate::generated::all::builders::ScriptBuilder,
514            ) -> &'a mut crate::generated::all::builders::ScriptBuilder,
515        {
516            let ty: crate::generated::all::Script = Default::default();
517            let mut ty_builder = crate::generated::all::builders::ScriptBuilder::new(ty);
518            (f)(&mut ty_builder);
519            let ty = ty_builder.build();
520            self.element.children_mut().push(ty.into());
521            self
522        }
523        /// Append a new `Template` element
524        pub fn template<F>(&mut self, f: F) -> &mut Self
525        where
526            F: for<'a> FnOnce(
527                &'a mut crate::generated::all::builders::TemplateBuilder,
528            ) -> &'a mut crate::generated::all::builders::TemplateBuilder,
529        {
530            let ty: crate::generated::all::Template = Default::default();
531            let mut ty_builder = crate::generated::all::builders::TemplateBuilder::new(
532                ty,
533            );
534            (f)(&mut ty_builder);
535            let ty = ty_builder.build();
536            self.element.children_mut().push(ty.into());
537            self
538        }
539        /// Set the value of the `aria-hidden` attribute
540        pub fn aria_hidden(&mut self, value: bool) -> &mut Self {
541            self.element.set_aria_hidden(value);
542            self
543        }
544        /// Set the value of the `accesskey` attribute
545        pub fn access_key(
546            &mut self,
547            value: impl Into<std::borrow::Cow<'static, str>>,
548        ) -> &mut Self {
549            self.element.set_access_key(Some(value.into()));
550            self
551        }
552        /// Set the value of the `autocapitalize` attribute
553        pub fn auto_capitalize(
554            &mut self,
555            value: impl Into<std::borrow::Cow<'static, str>>,
556        ) -> &mut Self {
557            self.element.set_auto_capitalize(Some(value.into()));
558            self
559        }
560        /// Set the value of the `autofocus` attribute
561        pub fn autofocus(&mut self, value: bool) -> &mut Self {
562            self.element.set_autofocus(value);
563            self
564        }
565        /// Set the value of the `class` attribute
566        pub fn class(
567            &mut self,
568            value: impl Into<std::borrow::Cow<'static, str>>,
569        ) -> &mut Self {
570            self.element.set_class(Some(value.into()));
571            self
572        }
573        /// Set the value of the `contenteditable` attribute
574        pub fn content_editable(
575            &mut self,
576            value: impl Into<std::borrow::Cow<'static, str>>,
577        ) -> &mut Self {
578            self.element.set_content_editable(Some(value.into()));
579            self
580        }
581        /// Set the value of the `dir` attribute
582        pub fn direction(
583            &mut self,
584            value: impl Into<std::borrow::Cow<'static, str>>,
585        ) -> &mut Self {
586            self.element.set_direction(Some(value.into()));
587            self
588        }
589        /// Set the value of the `draggable` attribute
590        pub fn draggable(&mut self, value: bool) -> &mut Self {
591            self.element.set_draggable(value);
592            self
593        }
594        /// Set the value of the `enterkeyhint` attribute
595        pub fn enter_key_hint(
596            &mut self,
597            value: impl Into<std::borrow::Cow<'static, str>>,
598        ) -> &mut Self {
599            self.element.set_enter_key_hint(Some(value.into()));
600            self
601        }
602        /// Set the value of the `exportparts` attribute
603        pub fn export_parts(
604            &mut self,
605            value: impl Into<std::borrow::Cow<'static, str>>,
606        ) -> &mut Self {
607            self.element.set_export_parts(Some(value.into()));
608            self
609        }
610        /// Set the value of the `hidden` attribute
611        pub fn hidden(
612            &mut self,
613            value: impl Into<std::borrow::Cow<'static, str>>,
614        ) -> &mut Self {
615            self.element.set_hidden(Some(value.into()));
616            self
617        }
618        /// Set the value of the `id` attribute
619        pub fn id(
620            &mut self,
621            value: impl Into<std::borrow::Cow<'static, str>>,
622        ) -> &mut Self {
623            self.element.set_id(Some(value.into()));
624            self
625        }
626        /// Set the value of the `inert` attribute
627        pub fn inert(&mut self, value: bool) -> &mut Self {
628            self.element.set_inert(value);
629            self
630        }
631        /// Set the value of the `inputmode` attribute
632        pub fn input_mode(
633            &mut self,
634            value: impl Into<std::borrow::Cow<'static, str>>,
635        ) -> &mut Self {
636            self.element.set_input_mode(Some(value.into()));
637            self
638        }
639        /// Set the value of the `is` attribute
640        pub fn is_(
641            &mut self,
642            value: impl Into<std::borrow::Cow<'static, str>>,
643        ) -> &mut Self {
644            self.element.set_is_(Some(value.into()));
645            self
646        }
647        /// Set the value of the `itemid` attribute
648        pub fn item_id(
649            &mut self,
650            value: impl Into<std::borrow::Cow<'static, str>>,
651        ) -> &mut Self {
652            self.element.set_item_id(Some(value.into()));
653            self
654        }
655        /// Set the value of the `itemprop` attribute
656        pub fn item_prop(
657            &mut self,
658            value: impl Into<std::borrow::Cow<'static, str>>,
659        ) -> &mut Self {
660            self.element.set_item_prop(Some(value.into()));
661            self
662        }
663        /// Set the value of the `itemref` attribute
664        pub fn item_ref(
665            &mut self,
666            value: impl Into<std::borrow::Cow<'static, str>>,
667        ) -> &mut Self {
668            self.element.set_item_ref(Some(value.into()));
669            self
670        }
671        /// Set the value of the `itemscope` attribute
672        pub fn item_scope(
673            &mut self,
674            value: impl Into<std::borrow::Cow<'static, str>>,
675        ) -> &mut Self {
676            self.element.set_item_scope(Some(value.into()));
677            self
678        }
679        /// Set the value of the `itemtype` attribute
680        pub fn item_type(
681            &mut self,
682            value: impl Into<std::borrow::Cow<'static, str>>,
683        ) -> &mut Self {
684            self.element.set_item_type(Some(value.into()));
685            self
686        }
687        /// Set the value of the `lang` attribute
688        pub fn lang(
689            &mut self,
690            value: impl Into<std::borrow::Cow<'static, str>>,
691        ) -> &mut Self {
692            self.element.set_lang(Some(value.into()));
693            self
694        }
695        /// Set the value of the `nonce` attribute
696        pub fn nonce(
697            &mut self,
698            value: impl Into<std::borrow::Cow<'static, str>>,
699        ) -> &mut Self {
700            self.element.set_nonce(Some(value.into()));
701            self
702        }
703        /// Set the value of the `part` attribute
704        pub fn part(
705            &mut self,
706            value: impl Into<std::borrow::Cow<'static, str>>,
707        ) -> &mut Self {
708            self.element.set_part(Some(value.into()));
709            self
710        }
711        /// Set the value of the `slot` attribute
712        pub fn slot(
713            &mut self,
714            value: impl Into<std::borrow::Cow<'static, str>>,
715        ) -> &mut Self {
716            self.element.set_slot(Some(value.into()));
717            self
718        }
719        /// Set the value of the `spellcheck` attribute
720        pub fn spellcheck(
721            &mut self,
722            value: impl Into<std::borrow::Cow<'static, str>>,
723        ) -> &mut Self {
724            self.element.set_spellcheck(Some(value.into()));
725            self
726        }
727        /// Set the value of the `style` attribute
728        pub fn style(
729            &mut self,
730            value: impl Into<std::borrow::Cow<'static, str>>,
731        ) -> &mut Self {
732            self.element.set_style(Some(value.into()));
733            self
734        }
735        /// Set the value of the `tabindex` attribute
736        pub fn tab_index(&mut self, value: i64) -> &mut Self {
737            self.element.set_tab_index(Some(value));
738            self
739        }
740        /// Set the value of the `title` attribute
741        pub fn title(
742            &mut self,
743            value: impl Into<std::borrow::Cow<'static, str>>,
744        ) -> &mut Self {
745            self.element.set_title(Some(value.into()));
746            self
747        }
748        /// Set the value of the `translate` attribute
749        pub fn translate(&mut self, value: bool) -> &mut Self {
750            self.element.set_translate(value);
751            self
752        }
753        /// Push a new child element to the list of children.
754        pub fn push<T>(&mut self, child_el: T) -> &mut Self
755        where
756            T: Into<crate::generated::all::children::PictureChild>,
757        {
758            let child_el = child_el.into();
759            self.element.children_mut().push(child_el);
760            self
761        }
762        /// Extend the list of children with an iterator of child elements.
763        pub fn extend<I, T>(&mut self, iter: I) -> &mut Self
764        where
765            I: IntoIterator<Item = T>,
766            T: Into<crate::generated::all::children::PictureChild>,
767        {
768            let iter = iter.into_iter().map(|child_el| child_el.into());
769            self.element.children_mut().extend(iter);
770            self
771        }
772    }
773}