html_sys/scripting/
noscript.rs1#[doc(alias = "noscript")]
5#[non_exhaustive]
6#[derive(Debug, Clone, PartialEq, Default)]
7pub struct NoScript {
8 pub data_map: crate::DataMap,
9 global_attrs: crate::GlobalAttributes,
10}
11impl crate::RenderElement for NoScript {
12 fn write_opening_tag<W: std::fmt::Write>(&self, writer: &mut W) -> std::fmt::Result {
13 write!(writer, "<noscript")?;
14 write!(writer, "{}", self.global_attrs)?;
15 write!(writer, "{}", self.data_map)?;
16 write!(writer, ">")?;
17 Ok(())
18 }
19 #[allow(unused_variables)]
20 fn write_closing_tag<W: std::fmt::Write>(&self, writer: &mut W) -> std::fmt::Result {
21 write!(writer, "</noscript>")?;
22 Ok(())
23 }
24}
25impl std::fmt::Display for NoScript {
26 fn fmt(&self, writer: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 use crate::RenderElement;
28 self.write_opening_tag(writer)?;
29 self.write_closing_tag(writer)?;
30 Ok(())
31 }
32}
33impl std::ops::Deref for NoScript {
34 type Target = crate::GlobalAttributes;
35 fn deref(&self) -> &Self::Target {
36 &self.global_attrs
37 }
38}
39impl std::ops::DerefMut for NoScript {
40 fn deref_mut(&mut self) -> &mut Self::Target {
41 &mut self.global_attrs
42 }
43}