Struct maud::Escaper [] [src]

pub struct Escaper<W: Write> {
    // some fields omitted
}

An adapter that escapes HTML special characters.

Example

use std::fmt::Write;
let mut escaper = Escaper::new(String::new());
write!(escaper, "<script>launchMissiles()</script>").unwrap();
assert_eq!(escaper.into_inner(), "&lt;script&gt;launchMissiles()&lt;/script&gt;");

Methods

impl<W: Write> Escaper<W>

fn new(inner: W) -> Escaper<W>

Creates an Escaper from a std::fmt::Write.

fn into_inner(self) -> W

Extracts the inner writer.

Trait Implementations

impl<W: Write> Write for Escaper<W>

fn write_str(&mut self, s: &str) -> Result

1.1.0fn write_char(&mut self, c: char) -> Result<(), Error>

1.0.0fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>