html/generated/
wbr.rs

1pub mod element {
2    /// The HTML `<wbr>` element
3    ///
4    /// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr)
5    #[doc(alias = "wbr")]
6    #[non_exhaustive]
7    #[derive(PartialEq, Clone, Default)]
8    pub struct LineBreakOpportunity {
9        sys: html_sys::text::LineBreakOpportunity,
10    }
11    impl LineBreakOpportunity {
12        /// Create a new builder
13        pub fn builder() -> super::builder::LineBreakOpportunityBuilder {
14            super::builder::LineBreakOpportunityBuilder::new(Default::default())
15        }
16    }
17    impl LineBreakOpportunity {
18        /// Access the element's `data-*` properties
19        pub fn data_map(&self) -> &html_sys::DataMap {
20            &self.sys.data_map
21        }
22        /// Mutably access the element's `data-*` properties
23        pub fn data_map_mut(&mut self) -> &mut html_sys::DataMap {
24            &mut self.sys.data_map
25        }
26    }
27    impl LineBreakOpportunity {
28        /// Get the value of the `role` attribute
29        pub fn role(&self) -> std::option::Option<&str> {
30            self.sys.role.as_deref()
31        }
32        /// Set the value of the `role` attribute
33        pub fn set_role(
34            &mut self,
35            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
36        ) {
37            self.sys.role = value.map(|v| v.into());
38        }
39        /// Get the value of the `aria-hidden` attribute
40        pub fn aria_hidden(&self) -> bool {
41            self.sys.aria_hidden
42        }
43        /// Set the value of the `aria-hidden` attribute
44        pub fn set_aria_hidden(&mut self, value: bool) {
45            self.sys.aria_hidden = value;
46        }
47        /// Get the value of the `accesskey` attribute
48        pub fn access_key(&self) -> std::option::Option<&str> {
49            self.sys.access_key.as_deref()
50        }
51        /// Set the value of the `accesskey` attribute
52        pub fn set_access_key(
53            &mut self,
54            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
55        ) {
56            self.sys.access_key = value.map(|v| v.into());
57        }
58        /// Get the value of the `autocapitalize` attribute
59        pub fn auto_capitalize(&self) -> std::option::Option<&str> {
60            self.sys.auto_capitalize.as_deref()
61        }
62        /// Set the value of the `autocapitalize` attribute
63        pub fn set_auto_capitalize(
64            &mut self,
65            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
66        ) {
67            self.sys.auto_capitalize = value.map(|v| v.into());
68        }
69        /// Get the value of the `autofocus` attribute
70        pub fn autofocus(&self) -> bool {
71            self.sys.autofocus
72        }
73        /// Set the value of the `autofocus` attribute
74        pub fn set_autofocus(&mut self, value: bool) {
75            self.sys.autofocus = value;
76        }
77        /// Get the value of the `class` attribute
78        pub fn class(&self) -> std::option::Option<&str> {
79            self.sys.class.as_deref()
80        }
81        /// Set the value of the `class` attribute
82        pub fn set_class(
83            &mut self,
84            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
85        ) {
86            self.sys.class = value.map(|v| v.into());
87        }
88        /// Get the value of the `contenteditable` attribute
89        pub fn content_editable(&self) -> std::option::Option<&str> {
90            self.sys.content_editable.as_deref()
91        }
92        /// Set the value of the `contenteditable` attribute
93        pub fn set_content_editable(
94            &mut self,
95            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
96        ) {
97            self.sys.content_editable = value.map(|v| v.into());
98        }
99        /// Get the value of the `dir` attribute
100        pub fn direction(&self) -> std::option::Option<&str> {
101            self.sys.direction.as_deref()
102        }
103        /// Set the value of the `dir` attribute
104        pub fn set_direction(
105            &mut self,
106            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
107        ) {
108            self.sys.direction = value.map(|v| v.into());
109        }
110        /// Get the value of the `draggable` attribute
111        pub fn draggable(&self) -> bool {
112            self.sys.draggable
113        }
114        /// Set the value of the `draggable` attribute
115        pub fn set_draggable(&mut self, value: bool) {
116            self.sys.draggable = value;
117        }
118        /// Get the value of the `enterkeyhint` attribute
119        pub fn enter_key_hint(&self) -> std::option::Option<&str> {
120            self.sys.enter_key_hint.as_deref()
121        }
122        /// Set the value of the `enterkeyhint` attribute
123        pub fn set_enter_key_hint(
124            &mut self,
125            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
126        ) {
127            self.sys.enter_key_hint = value.map(|v| v.into());
128        }
129        /// Get the value of the `exportparts` attribute
130        pub fn export_parts(&self) -> std::option::Option<&str> {
131            self.sys.export_parts.as_deref()
132        }
133        /// Set the value of the `exportparts` attribute
134        pub fn set_export_parts(
135            &mut self,
136            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
137        ) {
138            self.sys.export_parts = value.map(|v| v.into());
139        }
140        /// Get the value of the `hidden` attribute
141        pub fn hidden(&self) -> std::option::Option<&str> {
142            self.sys.hidden.as_deref()
143        }
144        /// Set the value of the `hidden` attribute
145        pub fn set_hidden(
146            &mut self,
147            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
148        ) {
149            self.sys.hidden = value.map(|v| v.into());
150        }
151        /// Get the value of the `id` attribute
152        pub fn id(&self) -> std::option::Option<&str> {
153            self.sys.id.as_deref()
154        }
155        /// Set the value of the `id` attribute
156        pub fn set_id(
157            &mut self,
158            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
159        ) {
160            self.sys.id = value.map(|v| v.into());
161        }
162        /// Get the value of the `inert` attribute
163        pub fn inert(&self) -> bool {
164            self.sys.inert
165        }
166        /// Set the value of the `inert` attribute
167        pub fn set_inert(&mut self, value: bool) {
168            self.sys.inert = value;
169        }
170        /// Get the value of the `inputmode` attribute
171        pub fn input_mode(&self) -> std::option::Option<&str> {
172            self.sys.input_mode.as_deref()
173        }
174        /// Set the value of the `inputmode` attribute
175        pub fn set_input_mode(
176            &mut self,
177            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
178        ) {
179            self.sys.input_mode = value.map(|v| v.into());
180        }
181        /// Get the value of the `is` attribute
182        pub fn is_(&self) -> std::option::Option<&str> {
183            self.sys.is_.as_deref()
184        }
185        /// Set the value of the `is` attribute
186        pub fn set_is_(
187            &mut self,
188            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
189        ) {
190            self.sys.is_ = value.map(|v| v.into());
191        }
192        /// Get the value of the `itemid` attribute
193        pub fn item_id(&self) -> std::option::Option<&str> {
194            self.sys.item_id.as_deref()
195        }
196        /// Set the value of the `itemid` attribute
197        pub fn set_item_id(
198            &mut self,
199            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
200        ) {
201            self.sys.item_id = value.map(|v| v.into());
202        }
203        /// Get the value of the `itemprop` attribute
204        pub fn item_prop(&self) -> std::option::Option<&str> {
205            self.sys.item_prop.as_deref()
206        }
207        /// Set the value of the `itemprop` attribute
208        pub fn set_item_prop(
209            &mut self,
210            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
211        ) {
212            self.sys.item_prop = value.map(|v| v.into());
213        }
214        /// Get the value of the `itemref` attribute
215        pub fn item_ref(&self) -> std::option::Option<&str> {
216            self.sys.item_ref.as_deref()
217        }
218        /// Set the value of the `itemref` attribute
219        pub fn set_item_ref(
220            &mut self,
221            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
222        ) {
223            self.sys.item_ref = value.map(|v| v.into());
224        }
225        /// Get the value of the `itemscope` attribute
226        pub fn item_scope(&self) -> std::option::Option<&str> {
227            self.sys.item_scope.as_deref()
228        }
229        /// Set the value of the `itemscope` attribute
230        pub fn set_item_scope(
231            &mut self,
232            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
233        ) {
234            self.sys.item_scope = value.map(|v| v.into());
235        }
236        /// Get the value of the `itemtype` attribute
237        pub fn item_type(&self) -> std::option::Option<&str> {
238            self.sys.item_type.as_deref()
239        }
240        /// Set the value of the `itemtype` attribute
241        pub fn set_item_type(
242            &mut self,
243            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
244        ) {
245            self.sys.item_type = value.map(|v| v.into());
246        }
247        /// Get the value of the `lang` attribute
248        pub fn lang(&self) -> std::option::Option<&str> {
249            self.sys.lang.as_deref()
250        }
251        /// Set the value of the `lang` attribute
252        pub fn set_lang(
253            &mut self,
254            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
255        ) {
256            self.sys.lang = value.map(|v| v.into());
257        }
258        /// Get the value of the `nonce` attribute
259        pub fn nonce(&self) -> std::option::Option<&str> {
260            self.sys.nonce.as_deref()
261        }
262        /// Set the value of the `nonce` attribute
263        pub fn set_nonce(
264            &mut self,
265            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
266        ) {
267            self.sys.nonce = value.map(|v| v.into());
268        }
269        /// Get the value of the `part` attribute
270        pub fn part(&self) -> std::option::Option<&str> {
271            self.sys.part.as_deref()
272        }
273        /// Set the value of the `part` attribute
274        pub fn set_part(
275            &mut self,
276            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
277        ) {
278            self.sys.part = value.map(|v| v.into());
279        }
280        /// Get the value of the `slot` attribute
281        pub fn slot(&self) -> std::option::Option<&str> {
282            self.sys.slot.as_deref()
283        }
284        /// Set the value of the `slot` attribute
285        pub fn set_slot(
286            &mut self,
287            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
288        ) {
289            self.sys.slot = value.map(|v| v.into());
290        }
291        /// Get the value of the `spellcheck` attribute
292        pub fn spellcheck(&self) -> std::option::Option<&str> {
293            self.sys.spellcheck.as_deref()
294        }
295        /// Set the value of the `spellcheck` attribute
296        pub fn set_spellcheck(
297            &mut self,
298            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
299        ) {
300            self.sys.spellcheck = value.map(|v| v.into());
301        }
302        /// Get the value of the `style` attribute
303        pub fn style(&self) -> std::option::Option<&str> {
304            self.sys.style.as_deref()
305        }
306        /// Set the value of the `style` attribute
307        pub fn set_style(
308            &mut self,
309            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
310        ) {
311            self.sys.style = value.map(|v| v.into());
312        }
313        /// Get the value of the `tabindex` attribute
314        pub fn tab_index(&self) -> std::option::Option<i64> {
315            self.sys.tab_index
316        }
317        /// Set the value of the `tabindex` attribute
318        pub fn set_tab_index(&mut self, value: std::option::Option<i64>) {
319            self.sys.tab_index = value;
320        }
321        /// Get the value of the `title` attribute
322        pub fn title(&self) -> std::option::Option<&str> {
323            self.sys.title.as_deref()
324        }
325        /// Set the value of the `title` attribute
326        pub fn set_title(
327            &mut self,
328            value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
329        ) {
330            self.sys.title = value.map(|v| v.into());
331        }
332        /// Get the value of the `translate` attribute
333        pub fn translate(&self) -> bool {
334            self.sys.translate
335        }
336        /// Set the value of the `translate` attribute
337        pub fn set_translate(&mut self, value: bool) {
338            self.sys.translate = value;
339        }
340    }
341    impl crate::Render for LineBreakOpportunity {
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            Ok(())
350        }
351    }
352    impl std::fmt::Debug for LineBreakOpportunity {
353        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
354            crate::Render::render(self, f, 0)?;
355            Ok(())
356        }
357    }
358    impl std::fmt::Display for LineBreakOpportunity {
359        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
360            html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
361            html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
362            Ok(())
363        }
364    }
365    impl crate::HtmlElement for LineBreakOpportunity {}
366    impl crate::FlowContent for LineBreakOpportunity {}
367    impl crate::PhrasingContent for LineBreakOpportunity {}
368    impl std::convert::Into<html_sys::text::LineBreakOpportunity>
369    for LineBreakOpportunity {
370        fn into(self) -> html_sys::text::LineBreakOpportunity {
371            self.sys
372        }
373    }
374    impl From<html_sys::text::LineBreakOpportunity> for LineBreakOpportunity {
375        fn from(sys: html_sys::text::LineBreakOpportunity) -> Self {
376            Self { sys }
377        }
378    }
379}
380pub mod child {}
381pub mod builder {
382    /// A builder struct for LineBreakOpportunity
383    pub struct LineBreakOpportunityBuilder {
384        element: super::element::LineBreakOpportunity,
385    }
386    impl LineBreakOpportunityBuilder {
387        pub(crate) fn new(element: super::element::LineBreakOpportunity) -> Self {
388            Self { element }
389        }
390        /// Finish building the element
391        pub fn build(&mut self) -> super::element::LineBreakOpportunity {
392            self.element.clone()
393        }
394        /// Insert a `data-*` property
395        pub fn data(
396            &mut self,
397            data_key: impl Into<std::borrow::Cow<'static, str>>,
398            value: impl Into<std::borrow::Cow<'static, str>>,
399        ) -> &mut LineBreakOpportunityBuilder {
400            self.element.data_map_mut().insert(data_key.into(), value.into());
401            self
402        }
403        /// Set the value of the `role` attribute
404        pub fn role(
405            &mut self,
406            value: impl Into<std::borrow::Cow<'static, str>>,
407        ) -> &mut Self {
408            self.element.set_role(Some(value.into()));
409            self
410        }
411        /// Set the value of the `aria-hidden` attribute
412        pub fn aria_hidden(&mut self, value: bool) -> &mut Self {
413            self.element.set_aria_hidden(value);
414            self
415        }
416        /// Set the value of the `accesskey` attribute
417        pub fn access_key(
418            &mut self,
419            value: impl Into<std::borrow::Cow<'static, str>>,
420        ) -> &mut Self {
421            self.element.set_access_key(Some(value.into()));
422            self
423        }
424        /// Set the value of the `autocapitalize` attribute
425        pub fn auto_capitalize(
426            &mut self,
427            value: impl Into<std::borrow::Cow<'static, str>>,
428        ) -> &mut Self {
429            self.element.set_auto_capitalize(Some(value.into()));
430            self
431        }
432        /// Set the value of the `autofocus` attribute
433        pub fn autofocus(&mut self, value: bool) -> &mut Self {
434            self.element.set_autofocus(value);
435            self
436        }
437        /// Set the value of the `class` attribute
438        pub fn class(
439            &mut self,
440            value: impl Into<std::borrow::Cow<'static, str>>,
441        ) -> &mut Self {
442            self.element.set_class(Some(value.into()));
443            self
444        }
445        /// Set the value of the `contenteditable` attribute
446        pub fn content_editable(
447            &mut self,
448            value: impl Into<std::borrow::Cow<'static, str>>,
449        ) -> &mut Self {
450            self.element.set_content_editable(Some(value.into()));
451            self
452        }
453        /// Set the value of the `dir` attribute
454        pub fn direction(
455            &mut self,
456            value: impl Into<std::borrow::Cow<'static, str>>,
457        ) -> &mut Self {
458            self.element.set_direction(Some(value.into()));
459            self
460        }
461        /// Set the value of the `draggable` attribute
462        pub fn draggable(&mut self, value: bool) -> &mut Self {
463            self.element.set_draggable(value);
464            self
465        }
466        /// Set the value of the `enterkeyhint` attribute
467        pub fn enter_key_hint(
468            &mut self,
469            value: impl Into<std::borrow::Cow<'static, str>>,
470        ) -> &mut Self {
471            self.element.set_enter_key_hint(Some(value.into()));
472            self
473        }
474        /// Set the value of the `exportparts` attribute
475        pub fn export_parts(
476            &mut self,
477            value: impl Into<std::borrow::Cow<'static, str>>,
478        ) -> &mut Self {
479            self.element.set_export_parts(Some(value.into()));
480            self
481        }
482        /// Set the value of the `hidden` attribute
483        pub fn hidden(
484            &mut self,
485            value: impl Into<std::borrow::Cow<'static, str>>,
486        ) -> &mut Self {
487            self.element.set_hidden(Some(value.into()));
488            self
489        }
490        /// Set the value of the `id` attribute
491        pub fn id(
492            &mut self,
493            value: impl Into<std::borrow::Cow<'static, str>>,
494        ) -> &mut Self {
495            self.element.set_id(Some(value.into()));
496            self
497        }
498        /// Set the value of the `inert` attribute
499        pub fn inert(&mut self, value: bool) -> &mut Self {
500            self.element.set_inert(value);
501            self
502        }
503        /// Set the value of the `inputmode` attribute
504        pub fn input_mode(
505            &mut self,
506            value: impl Into<std::borrow::Cow<'static, str>>,
507        ) -> &mut Self {
508            self.element.set_input_mode(Some(value.into()));
509            self
510        }
511        /// Set the value of the `is` attribute
512        pub fn is_(
513            &mut self,
514            value: impl Into<std::borrow::Cow<'static, str>>,
515        ) -> &mut Self {
516            self.element.set_is_(Some(value.into()));
517            self
518        }
519        /// Set the value of the `itemid` attribute
520        pub fn item_id(
521            &mut self,
522            value: impl Into<std::borrow::Cow<'static, str>>,
523        ) -> &mut Self {
524            self.element.set_item_id(Some(value.into()));
525            self
526        }
527        /// Set the value of the `itemprop` attribute
528        pub fn item_prop(
529            &mut self,
530            value: impl Into<std::borrow::Cow<'static, str>>,
531        ) -> &mut Self {
532            self.element.set_item_prop(Some(value.into()));
533            self
534        }
535        /// Set the value of the `itemref` attribute
536        pub fn item_ref(
537            &mut self,
538            value: impl Into<std::borrow::Cow<'static, str>>,
539        ) -> &mut Self {
540            self.element.set_item_ref(Some(value.into()));
541            self
542        }
543        /// Set the value of the `itemscope` attribute
544        pub fn item_scope(
545            &mut self,
546            value: impl Into<std::borrow::Cow<'static, str>>,
547        ) -> &mut Self {
548            self.element.set_item_scope(Some(value.into()));
549            self
550        }
551        /// Set the value of the `itemtype` attribute
552        pub fn item_type(
553            &mut self,
554            value: impl Into<std::borrow::Cow<'static, str>>,
555        ) -> &mut Self {
556            self.element.set_item_type(Some(value.into()));
557            self
558        }
559        /// Set the value of the `lang` attribute
560        pub fn lang(
561            &mut self,
562            value: impl Into<std::borrow::Cow<'static, str>>,
563        ) -> &mut Self {
564            self.element.set_lang(Some(value.into()));
565            self
566        }
567        /// Set the value of the `nonce` attribute
568        pub fn nonce(
569            &mut self,
570            value: impl Into<std::borrow::Cow<'static, str>>,
571        ) -> &mut Self {
572            self.element.set_nonce(Some(value.into()));
573            self
574        }
575        /// Set the value of the `part` attribute
576        pub fn part(
577            &mut self,
578            value: impl Into<std::borrow::Cow<'static, str>>,
579        ) -> &mut Self {
580            self.element.set_part(Some(value.into()));
581            self
582        }
583        /// Set the value of the `slot` attribute
584        pub fn slot(
585            &mut self,
586            value: impl Into<std::borrow::Cow<'static, str>>,
587        ) -> &mut Self {
588            self.element.set_slot(Some(value.into()));
589            self
590        }
591        /// Set the value of the `spellcheck` attribute
592        pub fn spellcheck(
593            &mut self,
594            value: impl Into<std::borrow::Cow<'static, str>>,
595        ) -> &mut Self {
596            self.element.set_spellcheck(Some(value.into()));
597            self
598        }
599        /// Set the value of the `style` attribute
600        pub fn style(
601            &mut self,
602            value: impl Into<std::borrow::Cow<'static, str>>,
603        ) -> &mut Self {
604            self.element.set_style(Some(value.into()));
605            self
606        }
607        /// Set the value of the `tabindex` attribute
608        pub fn tab_index(&mut self, value: i64) -> &mut Self {
609            self.element.set_tab_index(Some(value));
610            self
611        }
612        /// Set the value of the `title` attribute
613        pub fn title(
614            &mut self,
615            value: impl Into<std::borrow::Cow<'static, str>>,
616        ) -> &mut Self {
617            self.element.set_title(Some(value.into()));
618            self
619        }
620        /// Set the value of the `translate` attribute
621        pub fn translate(&mut self, value: bool) -> &mut Self {
622            self.element.set_translate(value);
623            self
624        }
625    }
626}