1#[doc(alias = "video")]
5#[non_exhaustive]
6#[derive(Debug, Clone, PartialEq, Default)]
7pub struct Video {
8 pub data_map: crate::DataMap,
9 global_attrs: crate::GlobalAttributes,
10 pub src: std::option::Option<std::borrow::Cow<'static, str>>,
12 pub crossorigin: std::option::Option<std::borrow::Cow<'static, str>>,
14 pub poster: std::option::Option<std::borrow::Cow<'static, str>>,
16 pub preload: std::option::Option<std::borrow::Cow<'static, str>>,
18 pub autoplay: std::option::Option<std::borrow::Cow<'static, str>>,
20 pub plays_inline: bool,
22 pub loop_: std::option::Option<std::borrow::Cow<'static, str>>,
24 pub muted: std::option::Option<std::borrow::Cow<'static, str>>,
26 pub controls: std::option::Option<std::borrow::Cow<'static, str>>,
28 pub width: std::option::Option<i64>,
30 pub height: std::option::Option<i64>,
32 pub role: std::option::Option<std::borrow::Cow<'static, str>>,
34 pub aria_active_descendant_element: std::option::Option<
36 std::borrow::Cow<'static, str>,
37 >,
38 pub aria_atomic: bool,
40 pub aria_braille_label: std::option::Option<std::borrow::Cow<'static, str>>,
42 pub aria_braille_role_description: std::option::Option<
44 std::borrow::Cow<'static, str>,
45 >,
46 pub aria_busy: bool,
48 pub aria_controls_elements: std::option::Option<std::borrow::Cow<'static, str>>,
50 pub aria_current: std::option::Option<std::borrow::Cow<'static, str>>,
52 pub aria_described_by_elements: std::option::Option<std::borrow::Cow<'static, str>>,
54 pub aria_description: std::option::Option<std::borrow::Cow<'static, str>>,
56 pub aria_details_elements: std::option::Option<std::borrow::Cow<'static, str>>,
58 pub aria_disabled: bool,
60 pub aria_drop_effect: std::option::Option<std::borrow::Cow<'static, str>>,
62 pub aria_error_message_elements: std::option::Option<std::borrow::Cow<'static, str>>,
64 pub aria_expanded: bool,
66 pub aria_flow_to_elements: std::option::Option<std::borrow::Cow<'static, str>>,
68 pub aria_grabbed: bool,
70 pub aria_has_popup: std::option::Option<std::borrow::Cow<'static, str>>,
72 pub aria_hidden: bool,
74 pub aria_invalid: std::option::Option<std::borrow::Cow<'static, str>>,
76 pub aria_key_shortcuts: std::option::Option<std::borrow::Cow<'static, str>>,
78 pub aria_label: std::option::Option<std::borrow::Cow<'static, str>>,
80 pub aria_labelled_by_elements: std::option::Option<std::borrow::Cow<'static, str>>,
82 pub aria_live: std::option::Option<std::borrow::Cow<'static, str>>,
84 pub aria_owns_elements: std::option::Option<std::borrow::Cow<'static, str>>,
86 pub aria_relevant: std::option::Option<std::borrow::Cow<'static, str>>,
88 pub aria_role_description: std::option::Option<std::borrow::Cow<'static, str>>,
90}
91impl crate::RenderElement for Video {
92 fn write_opening_tag<W: std::fmt::Write>(&self, writer: &mut W) -> std::fmt::Result {
93 write!(writer, "<video")?;
94 if let Some(field) = self.src.as_ref() {
95 write!(writer, r#" src="{field}""#)?;
96 }
97 if let Some(field) = self.crossorigin.as_ref() {
98 write!(writer, r#" crossorigin="{field}""#)?;
99 }
100 if let Some(field) = self.poster.as_ref() {
101 write!(writer, r#" poster="{field}""#)?;
102 }
103 if let Some(field) = self.preload.as_ref() {
104 write!(writer, r#" preload="{field}""#)?;
105 }
106 if let Some(field) = self.autoplay.as_ref() {
107 write!(writer, r#" autoplay="{field}""#)?;
108 }
109 if self.plays_inline {
110 write!(writer, r#" playsinline"#)?;
111 }
112 if let Some(field) = self.loop_.as_ref() {
113 write!(writer, r#" loop="{field}""#)?;
114 }
115 if let Some(field) = self.muted.as_ref() {
116 write!(writer, r#" muted="{field}""#)?;
117 }
118 if let Some(field) = self.controls.as_ref() {
119 write!(writer, r#" controls="{field}""#)?;
120 }
121 if let Some(field) = self.width.as_ref() {
122 write!(writer, r#" width="{field}""#)?;
123 }
124 if let Some(field) = self.height.as_ref() {
125 write!(writer, r#" height="{field}""#)?;
126 }
127 if let Some(field) = self.role.as_ref() {
128 write!(writer, r#" role="{field}""#)?;
129 }
130 if let Some(field) = self.aria_active_descendant_element.as_ref() {
131 write!(writer, r#" aria-activedescendant="{field}""#)?;
132 }
133 if self.aria_atomic {
134 write!(writer, r#" aria-atomic"#)?;
135 }
136 if let Some(field) = self.aria_braille_label.as_ref() {
137 write!(writer, r#" aria-braillelabel="{field}""#)?;
138 }
139 if let Some(field) = self.aria_braille_role_description.as_ref() {
140 write!(writer, r#" aria-brailleroledescription="{field}""#)?;
141 }
142 if self.aria_busy {
143 write!(writer, r#" aria-busy"#)?;
144 }
145 if let Some(field) = self.aria_controls_elements.as_ref() {
146 write!(writer, r#" aria-controls="{field}""#)?;
147 }
148 if let Some(field) = self.aria_current.as_ref() {
149 write!(writer, r#" aria-current="{field}""#)?;
150 }
151 if let Some(field) = self.aria_described_by_elements.as_ref() {
152 write!(writer, r#" aria-describedby="{field}""#)?;
153 }
154 if let Some(field) = self.aria_description.as_ref() {
155 write!(writer, r#" aria-description="{field}""#)?;
156 }
157 if let Some(field) = self.aria_details_elements.as_ref() {
158 write!(writer, r#" aria-details="{field}""#)?;
159 }
160 if self.aria_disabled {
161 write!(writer, r#" aria-disabled"#)?;
162 }
163 if let Some(field) = self.aria_drop_effect.as_ref() {
164 write!(writer, r#" aria-dropeffect="{field}""#)?;
165 }
166 if let Some(field) = self.aria_error_message_elements.as_ref() {
167 write!(writer, r#" aria-errormessage="{field}""#)?;
168 }
169 if self.aria_expanded {
170 write!(writer, r#" aria-expanded"#)?;
171 }
172 if let Some(field) = self.aria_flow_to_elements.as_ref() {
173 write!(writer, r#" aria-flowto="{field}""#)?;
174 }
175 if self.aria_grabbed {
176 write!(writer, r#" aria-grabbed"#)?;
177 }
178 if let Some(field) = self.aria_has_popup.as_ref() {
179 write!(writer, r#" aria-haspopup="{field}""#)?;
180 }
181 if self.aria_hidden {
182 write!(writer, r#" aria-hidden"#)?;
183 }
184 if let Some(field) = self.aria_invalid.as_ref() {
185 write!(writer, r#" aria-invalid="{field}""#)?;
186 }
187 if let Some(field) = self.aria_key_shortcuts.as_ref() {
188 write!(writer, r#" aria-keyshortcuts="{field}""#)?;
189 }
190 if let Some(field) = self.aria_label.as_ref() {
191 write!(writer, r#" aria-label="{field}""#)?;
192 }
193 if let Some(field) = self.aria_labelled_by_elements.as_ref() {
194 write!(writer, r#" aria-labelledby="{field}""#)?;
195 }
196 if let Some(field) = self.aria_live.as_ref() {
197 write!(writer, r#" aria-live="{field}""#)?;
198 }
199 if let Some(field) = self.aria_owns_elements.as_ref() {
200 write!(writer, r#" aria-owns="{field}""#)?;
201 }
202 if let Some(field) = self.aria_relevant.as_ref() {
203 write!(writer, r#" aria-relevant="{field}""#)?;
204 }
205 if let Some(field) = self.aria_role_description.as_ref() {
206 write!(writer, r#" aria-roledescription="{field}""#)?;
207 }
208 write!(writer, "{}", self.global_attrs)?;
209 write!(writer, "{}", self.data_map)?;
210 write!(writer, ">")?;
211 Ok(())
212 }
213 #[allow(unused_variables)]
214 fn write_closing_tag<W: std::fmt::Write>(&self, writer: &mut W) -> std::fmt::Result {
215 write!(writer, "</video>")?;
216 Ok(())
217 }
218}
219impl std::fmt::Display for Video {
220 fn fmt(&self, writer: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
221 use crate::RenderElement;
222 self.write_opening_tag(writer)?;
223 self.write_closing_tag(writer)?;
224 Ok(())
225 }
226}
227impl std::ops::Deref for Video {
228 type Target = crate::GlobalAttributes;
229 fn deref(&self) -> &Self::Target {
230 &self.global_attrs
231 }
232}
233impl std::ops::DerefMut for Video {
234 fn deref_mut(&mut self) -> &mut Self::Target {
235 &mut self.global_attrs
236 }
237}