[][src]Struct maud::Escaper

pub struct Escaper<'a>(_);

An adapter that escapes HTML special characters.

The following characters are escaped:

  • & is escaped as &amp;
  • < is escaped as &lt;
  • > is escaped as &gt;
  • " is escaped as &quot;

All other characters are passed through unchanged.

Note: In versions prior to 0.13, the single quote (') was escaped as well.

Example

This example is not tested
use std::fmt::Write;
let mut s = String::new();
write!(Escaper::new(&mut s), "<script>launchMissiles()</script>").unwrap();
assert_eq!(s, "&lt;script&gt;launchMissiles()&lt;/script&gt;");

Implementations

impl<'a> Escaper<'a>[src]

pub fn new(buffer: &'a mut String) -> Escaper<'a>[src]

Creates an Escaper from a String.

Trait Implementations

impl<'a> Write for Escaper<'a>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,