Struct trimmer::Parser
[−]
[src]
pub struct Parser { /* fields omitted */ }
A reusable parser
Instance of this class must (and should) be reused for compiling multiple templates
Methods
impl Parser
[src]
fn new() -> Parser
Create a new parser
Note: it's expensive to create a new parser (i.e. it compiles regular expressions) so you should reuse the parser instance if you're going to compile multiple templates.
fn parse(&self, data: &str) -> Result<Template, ParseError>
Parse and compile a template
fn parse_with_options(
&self,
options: &Options,
data: &str
) -> Result<Template, ParseError>
&self,
options: &Options,
data: &str
) -> Result<Template, ParseError>
Parse and compile a template with some predefined options set