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>
[src]

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>
[src]

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

Writes a slice of bytes into this writer, returning whether the write succeeded. Read more

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

Writes a char into this writer, returning whether the write succeeded. Read more

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

Glue for usage of the write! macro with implementors of this trait. Read more