1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use {Namespace, Prefix};
use cssparser::SourceLocation;
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use std::fmt;
#[derive(Clone, Debug, PartialEq)]
#[allow(missing_docs)]
pub struct NamespaceRule {
pub prefix: Option<Prefix>,
pub url: Namespace,
pub source_location: SourceLocation,
}
impl ToCssWithGuard for NamespaceRule {
fn to_css<W>(&self, _guard: &SharedRwLockReadGuard, dest: &mut W) -> fmt::Result
where W: fmt::Write {
dest.write_str("@namespace ")?;
if let Some(ref prefix) = self.prefix {
dest.write_str(&*prefix.to_string())?;
dest.write_str(" ")?;
}
dest.write_str("url(\"")?;
dest.write_str(&*self.url.to_string())?;
dest.write_str("\");")
}
}