Skip to main content

DocxTemplate

Trait DocxTemplate 

Source
pub trait DocxTemplate {
    // Required methods
    fn template_path(&self) -> &Path;
    fn replacements(&self) -> Vec<(&str, &str)>;
}
Expand description

Trait implemented by all generated template structs.

You won’t typically call these methods directly — use the generated save() and to_bytes() methods on the struct instead.

Required Methods§

Source

fn template_path(&self) -> &Path

Returns the path to the original .docx template file.

Source

fn replacements(&self) -> Vec<(&str, &str)>

Returns placeholder/value pairs for substitution.

Implementors§