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