Make the renderer a bit more generic.

This commit is contained in:
Tom Alexander
2023-10-22 16:40:58 -04:00
parent aed88cf05a
commit fc5342adce
4 changed files with 20 additions and 15 deletions

View File

@@ -1,4 +1,6 @@
use super::renderer_integration::RendererIntegration;
use duster::renderer::DustRenderer;
use serde::Serialize;
pub(crate) struct DusterRenderer {}
@@ -8,17 +10,18 @@ impl RendererIntegration for DusterRenderer {
I: Iterator<Item = P>,
P: Into<std::path::PathBuf>,
{
todo!()
// TODO
Ok(())
}
fn render<P>(
&self,
context: &str,
build_directory: P,
) -> Result<String, crate::error::CustomError>
fn render<C>(&self, context: C) -> Result<String, crate::error::CustomError>
where
P: AsRef<std::path::Path>,
C: Serialize,
{
todo!()
let mut dust_renderer = DustRenderer::new();
println!("{}", serde_json::to_string(&context)?);
// TODO
Ok("".to_owned())
}
}