Struct horrorshow::TemplateBuilder [] [src]

pub struct TemplateBuilder<'a>(_);

A template builder. This is the type that gets passed to closures inside templates.

Example:

    html! {
        |tmpl /*: &mut TemplateBuilder */| tmpl << "Some String";
    };

Methods

impl<'a> TemplateBuilder<'a>
[src]

fn write_raw(&mut self, text: &str)

Write a raw string to the template output.

fn write_fmt(&mut self, args: Arguments)

Escape and write the formatted arguments to the template output.

Example:

write!(tmpl, "{} + {}", 0, 1);

fn write_str(&mut self, text: &str)

Escape and write a string to the template output.

Trait Implementations

impl<'a, 'b, T> Shl<T> for &'a mut TemplateBuilder<'b> where T: RenderOnce
[src]

type Output = &'a mut TemplateBuilder<'b>

The resulting type after applying the << operator

fn shl(self, component: T) -> &'a mut TemplateBuilder<'b>

Render the component into the template.

Note: If writing to the template fails, this method will neither panic nor return errors. Instead, no more data will be written to the template and horrorshow abort template rendering (return an error) when it re-gains control.