Render

Trait Render 

Source
pub trait Render {
    const ESTIMATED_LENGTH: usize;

    // Required method
    fn render_into<W: Write>(&self, writer: &mut W) -> Result;

    // Provided method
    fn render(&self) -> Result<String, Error> { ... }
}
Expand description

Optimized render function trait.

Required Associated Constants§

Source

const ESTIMATED_LENGTH: usize

Estimated output length of the template.

Required Methods§

Source

fn render_into<W: Write>(&self, writer: &mut W) -> Result

Render the template into a writer.

§Errors

If strings cannot be written to the formatter.

Provided Methods§

Source

fn render(&self) -> Result<String, Error>

Render the template into a string.

§Errors

If strings cannot be written to the formatter.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§