natter/src/render/duster_renderer.rs

28 lines
698 B
Rust
Raw Normal View History

use super::renderer_integration::RendererIntegration;
2023-10-22 16:40:58 -04:00
use duster::renderer::DustRenderer;
use serde::Serialize;
pub(crate) struct DusterRenderer {}
impl RendererIntegration for DusterRenderer {
fn load_templates<I, P>(&mut self, dust_templates: I) -> Result<(), crate::error::CustomError>
where
I: Iterator<Item = P>,
P: Into<std::path::PathBuf>,
{
2023-10-22 16:40:58 -04:00
// TODO
Ok(())
}
2023-10-22 16:40:58 -04:00
fn render<C>(&self, context: C) -> Result<String, crate::error::CustomError>
where
2023-10-22 16:40:58 -04:00
C: Serialize,
{
2023-10-22 16:40:58 -04:00
let mut dust_renderer = DustRenderer::new();
println!("{}", serde_json::to_string(&context)?);
// TODO
Ok("".to_owned())
}
}