pub struct TemplateEngine { /* private fields */ }Expand description
Template engine to manage multiple templates
Implementations§
Source§impl TemplateEngine
impl TemplateEngine
pub fn new() -> Self
pub fn add_template( &mut self, name: impl Into<String>, source: impl Into<String>, ) -> Result<()>
pub fn get_template(&self, name: &str) -> Option<&Template>
pub fn render(&self, name: &str, context: &Context) -> Result<String>
Sourcepub fn render_response(
&self,
name: &str,
context: &Context,
) -> Result<OxiditeResponse>
pub fn render_response( &self, name: &str, context: &Context, ) -> Result<OxiditeResponse>
Render a template as an HTML response
Trait Implementations§
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