Struct jens::Template [−][src]
pub struct Template { /* fields omitted */ }
Methods
impl Template
[src]
impl Template
pub fn replace(&mut self, find: &str, replace: &str)
[src]
pub fn replace(&mut self, find: &str, replace: &str)
Replaces a matching string anywhere inside this template and subtemplates
pub fn with_template(&mut self, section_name: &str, map: &Fn(&mut Template))
[src]
pub fn with_template(&mut self, section_name: &str, map: &Fn(&mut Template))
Process a specific template section
pub fn repeat_template<T>(
&mut self,
section_name: &str,
values: &Vec<T>,
map: &Fn(&T, &mut Template)
)
[src]
pub fn repeat_template<T>(
&mut self,
section_name: &str,
values: &Vec<T>,
map: &Fn(&T, &mut Template)
)
Repeats a template section for each of values
, running map
over each instance
pub fn output(&self) -> String
[src]
pub fn output(&self) -> String
pub fn parse(template_str: &str) -> Template
[src]
pub fn parse(template_str: &str) -> Template
Parse template source into a Template
Trait Implementations
impl Debug for Template
[src]
impl Debug for Template
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Template
[src]
impl Clone for Template