Trait horrorshow::Template [] [src]

pub trait Template: RenderOnce {
    fn into_string(self) -> String where Self: Sized { ... }
    fn write_to_string(self, string: &mut String) where Self: Sized { ... }
    fn write_to_fmt(self, writer: &mut Write) -> Result<()Error> where Self: Sized { ... }
    fn write_to_io(self, writer: &mut Write) -> Result<()Error> where Self: Sized { ... }
}

Provided Methods

fn into_string(self) -> String where Self: Sized

Render this into a new String.

fn write_to_string(self, string: &mut String) where Self: Sized

Render this into an existing String.

Note: You could also use render_into_fmt but this is noticeably faster.

fn write_to_fmt(self, writer: &mut Write) -> Result<()Error> where Self: Sized

Render this into something that implements fmt::Write.

Renderer also implements Display but that's about twice as slow...

fn write_to_io(self, writer: &mut Write) -> Result<()Error> where Self: Sized

Render this into something that implements io::Write.

Note: If you're writing directly to a file/socket etc., you should seriously consider wrapping your writer in a BufWriter. Otherwise, you'll end up making quite a few unnecessary system calls.

Implementors