pub struct Escaper<'a>(_);
Expand description
An adapter that escapes HTML special characters.
The following characters are escaped:
&
is escaped as&
<
is escaped as<
>
is escaped as>
"
is escaped as"
All other characters are passed through unchanged.
Note: In versions prior to 0.13, the single quote ('
) was
escaped as well.
Example
use maud::Escaper;
use std::fmt::Write;
let mut s = String::new();
write!(Escaper::new(&mut s), "<script>launchMissiles()</script>").unwrap();
assert_eq!(s, "<script>launchMissiles()</script>");
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Escaper<'a>
impl<'a> Send for Escaper<'a>
impl<'a> Sync for Escaper<'a>
impl<'a> Unpin for Escaper<'a>
impl<'a> !UnwindSafe for Escaper<'a>
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,
Converts
self
into a collection.