Trait askama::filters::Escaper

source ·
pub trait Escaper: Copy {
    // Required method
    fn write_escaped_str<W: Write>(&self, dest: W, string: &str) -> Result;

    // Provided method
    fn write_escaped_char<W: Write>(&self, dest: W, c: char) -> Result { ... }
}
Expand description

Escapers are used to make generated text safe for printing in some context.

E.g. in an Html context, any and all generated text can be used in HTML/XML text nodes and attributes, without for for maliciously injected data.

Required Methods§

source

fn write_escaped_str<W: Write>(&self, dest: W, string: &str) -> Result

Escaped the input string string into dest

Provided Methods§

source

fn write_escaped_char<W: Write>(&self, dest: W, c: char) -> Result

Escaped the input char c into dest

Object Safety§

This trait is not object safe.

Implementors§