pub struct TemplateEngine {
pub templates: HashMap<String, Template>,
}Fields§
§templates: HashMap<String, Template>Implementations§
source§impl TemplateEngine
impl TemplateEngine
pub fn new() -> Self
pub fn add_template_from_file(&mut self, name: &str, path: &Path) -> Result<()>
pub fn add_template_from_string( &mut self, name: &str, template: &str, ) -> Result<(), String>
pub fn render( &self, name: &str, context: &HashMap<String, Value>, ) -> Result<String, String>
Auto Trait Implementations§
impl Freeze for TemplateEngine
impl RefUnwindSafe for TemplateEngine
impl Send for TemplateEngine
impl Sync for TemplateEngine
impl Unpin for TemplateEngine
impl UnwindSafe for TemplateEngine
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more