Struct horrorshow::TemplateBuffer
[−]
[src]
pub struct TemplateBuffer<'a> { /* fields omitted */ }
A template buffer. This is the type that gets passed to closures inside templates.
Example:
html! { |tmpl /*: &mut TemplateBuffer */| tmpl << "Some String"; };
Methods
impl<'a> TemplateBuffer<'a>
[src]
impl<'a> TemplateBuffer<'a>
pub fn record_error<E: Into<Box<Error + Send + Sync>>>(&mut self, e: E)
[src]
pub fn record_error<E: Into<Box<Error + Send + Sync>>>(&mut self, e: E)
pub fn write_raw(&mut self, text: &str)
[src]
pub fn write_raw(&mut self, text: &str)
Write a raw string to the template output.
pub fn write_fmt(&mut self, args: Arguments)
[src]
pub fn write_fmt(&mut self, args: Arguments)
Escape and write the formatted arguments to the template output.
Example:
write!(tmpl, "{} + {}", 0, 1);
pub fn write_str(&mut self, text: &str)
[src]
pub fn write_str(&mut self, text: &str)
Escape and write a string to the template output.
pub fn as_writer<'b>(&'b mut self) -> TemplateWriter<'a, 'b>
[src]
pub fn as_writer<'b>(&'b mut self) -> TemplateWriter<'a, 'b>
Returns an escaping Write adapter.
pub fn as_raw_writer<'b>(&'b mut self) -> RawTemplateWriter<'a, 'b>
[src]
pub fn as_raw_writer<'b>(&'b mut self) -> RawTemplateWriter<'a, 'b>
Returns a non-escaping Write adapter.
Trait Implementations
impl<'a, 'b, T> Shl<T> for &'a mut TemplateBuffer<'b> where
T: RenderOnce,
[src]
impl<'a, 'b, T> Shl<T> for &'a mut TemplateBuffer<'b> where
T: RenderOnce,
type Output = ()
The resulting type after applying the <<
operator.
fn shl(self, component: T)
[src]
fn shl(self, component: T)
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.
Auto Trait Implementations
impl<'a> !Send for TemplateBuffer<'a>
impl<'a> !Send for TemplateBuffer<'a>
impl<'a> !Sync for TemplateBuffer<'a>
impl<'a> !Sync for TemplateBuffer<'a>