2023-10-22 20:40:58 +00:00
|
|
|
use serde::Serialize;
|
|
|
|
|
2023-10-22 20:26:43 +00:00
|
|
|
use crate::error::CustomError;
|
|
|
|
|
2023-10-22 20:40:58 +00:00
|
|
|
pub(crate) trait RendererIntegration {
|
2023-10-22 21:31:12 +00:00
|
|
|
fn load_template<N, C>(&mut self, name: N, contents: C) -> Result<(), CustomError>
|
2023-10-22 20:26:43 +00:00
|
|
|
where
|
2023-10-22 21:31:12 +00:00
|
|
|
N: Into<String>,
|
2023-10-22 21:37:27 +00:00
|
|
|
C: AsRef<str>;
|
2023-10-22 20:26:43 +00:00
|
|
|
|
2023-10-22 21:37:27 +00:00
|
|
|
fn render<C>(&self, context: C) -> Result<String, CustomError>
|
2023-10-22 20:26:43 +00:00
|
|
|
where
|
2023-10-22 20:40:58 +00:00
|
|
|
C: Serialize;
|
2023-10-22 20:26:43 +00:00
|
|
|
}
|