Make the renderer a bit more generic.
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::error::CustomError;
|
||||
|
||||
pub trait RendererIntegration {
|
||||
pub(crate) trait RendererIntegration {
|
||||
fn load_templates<I, P>(&mut self, dust_templates: I) -> Result<(), CustomError>
|
||||
where
|
||||
I: Iterator<Item = P>,
|
||||
P: Into<PathBuf>;
|
||||
|
||||
fn render<P>(&self, context: &str, build_directory: P) -> Result<String, CustomError>
|
||||
fn render<C>(&self, context: C) -> Result<String, crate::error::CustomError>
|
||||
where
|
||||
P: AsRef<Path>;
|
||||
C: Serialize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user