pub struct Escaper<'a>(_);
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.
use std::fmt::Write;
let mut s = String::new();
write!(Escaper::new(&mut s), "<script>launchMissiles()</script>").unwrap();
assert_eq!(s, "<script>launchMissiles()</script>");
Creates an Escaper
from a String
.
Writes a slice of bytes into this writer, returning whether the write succeeded. Read more
Writes a [char
] into this writer, returning whether the write succeeded. Read more
Glue for usage of the [write!
] macro with implementors of this trait. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<T> Typeable for T where T: Any, | |
Get the TypeId
of this object.
impl<T> UnsafeAny for T where T: Any, | |
impl<T> IntoCollection for T | |
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where A: Array<Item = U>, F: FnMut(T) -> U, | |
impl<T, I> AsResult for T where I: Input, | |