Logo
Explore Help
Sign In
talexander/natter
1
0
Fork 0
You've already forked natter
Code Issues Pull Requests Releases Activity
natter/src/render/renderer_integration.rs

12 lines
294 B
Rust
Raw Normal View History

Make the renderer a bit more generic.
2023-10-22 16:40:58 -04:00
use serde::Serialize;
Starting to create the renderer integrations. These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00
use crate::error::CustomError;
I think I have worked around the lifetime issue by keeping references to the intermediate str's.
2023-10-22 17:43:30 -04:00
pub(crate) trait RendererIntegration<'a> {
fn load_template(&mut self, name: &'a str, contents: &'a str) -> Result<(), CustomError>;
Starting to create the renderer integrations. These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00
Invoking the compile function. I am going to have to address the lifetime issue of "compiled" duster templates borrowing the input str.
2023-10-22 17:37:27 -04:00
fn render<C>(&self, context: C) -> Result<String, CustomError>
Starting to create the renderer integrations. These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00
where
Make the renderer a bit more generic.
2023-10-22 16:40:58 -04:00
C: Serialize;
Starting to create the renderer integrations. These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.1 Page: 277ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API