Trait iron_archivist::Renderer [] [src]

pub trait Renderer {
    fn render_dir(&self, path_str: &str, entries: &[Entry]) -> RenderResult;
fn render_verbatim(&self, path_str: &str, content: &str) -> RenderResult;
fn render_markdown(&self, path_str: &str, content: &str) -> RenderResult;
fn render_error(
        &self,
        path_str: &str,
        code: usize,
        message: &str
    ) -> RenderResult; }

A renderer that renders the webpage in the response

An implementation is provided for tera::Tera. Turn on the tera feature to use this implementation.

See examples/simple.rs for a minimal implementation of the renderer.

Required Methods

Renders the list of entries in a directory.

Arguments

  • path_str - The path to the specified directory as an str slice
  • entries - The entries in the specified path

Renders the unmodified textual content of a file.

Arguments

  • path_str - The path to the specified file as an str slice
  • entries - The textual content of the file

Renders a file as a Markdown file.

Arguments

  • path_str - The path to the specified file as an str slice
  • content - The content of the file, already rendered to HTML

Renders an error message

Arguments

  • path_str - The path to the specified file as an str slice
  • code - HTTP status code for the error
  • message - An message describing the error

Implementors