Trait cryogen_prelude::CompileVariablePlugin [] [src]

pub trait CompileVariablePlugin {
    type RenderValue: Serialize;
    fn plugin_name() -> &'static str;
    fn arg_full_name() -> &'static str;
    fn arg_help() -> &'static str;
    fn additional_args() -> Vec<Arg<'static, 'static>>;
    fn from_args<'a>(args: &'a ArgMatches<'a>) -> Self;
    fn read_file(&self, file: File) -> Result<Self::RenderValue, String>;

    fn read_path<P: AsRef<Path>>(
        &self,
        path: P
    ) -> Result<Self::RenderValue, String> { ... } }

A plugin that can assign a value to a variable in the Tera context from a file.

Associated Types

The serializable value to add to the Tera context.

Required Methods

The name of the plugin.

The name of the argument that provides the variable name to file mapping.

The help string to display.

Optional arguments to supply. These should be prefixed to avoid namespace clashes.

Constructor for building the plugin from the supplied command line arguments.

Reads and parses the supplied file. The result is stored in the Tera context.

Provided Methods

Reads and parses a file at a specific path.

Implementors