Struct maud::Escaper [−][src]
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 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
Writes a string slice into this writer, returning whether the write succeeded. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for Escaper<'a>
impl<'a> !UnwindSafe for Escaper<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more