atom-engine 5.0.2

A component-oriented template engine built on Tera with props, slots, and provide/inject context
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::error::RenderError;

pub trait TransformFn: Send + Sync {
    fn apply(&self, content: &str) -> Result<String, RenderError>;
}

impl<F> TransformFn for F
where
    F: Fn(&str) -> Result<String, RenderError> + Send + Sync + 'static,
{
    fn apply(&self, content: &str) -> Result<String, RenderError> {
        self(content)
    }
}