Struct fast_escape::Escaper
[−]
[src]
pub struct Escaper<C: ContainsChar> { /* fields omitted */ }
This struct provides escaping of characters.
Methods
impl<C: ContainsChar> Escaper<C>
[src]
fn new(escape_char: char, special_chars: C) -> Self
Creates the escaper.
escape_char
is the char which is used for escaping (e.g. '\')
special_chars
is set of chars that should be escaped.
Trait Implementations
impl<C: ContainsChar> Transform for Escaper<C>
[src]
fn transform_char<W: Write>(
&self,
writer: &mut W,
c: char
) -> Result<(), W::Error>
&self,
writer: &mut W,
c: char
) -> Result<(), W::Error>
Writes transformed char into provided writer.
fn transform_size_hint(&self, bytes: usize) -> usize
Calculates new size hint based on how transformation affects output size. Read more
fn transform_str<W>(
&self,
writer: &mut W,
s: &str
) -> Result<(), <W as Write>::Error> where
W: Write,
&self,
writer: &mut W,
s: &str
) -> Result<(), <W as Write>::Error> where
W: Write,
Writes transformed string into provided writer.