pub struct HandlebarsEngine { /* private fields */ }Expand description
Handlebars-based template engine for emails.
Implementations§
Source§impl HandlebarsEngine
impl HandlebarsEngine
Sourcepub fn from_directory(path: impl AsRef<Path>) -> Result<Self>
pub fn from_directory(path: impl AsRef<Path>) -> Result<Self>
Load templates from a directory.
Expected structure:
templates/
welcome/
subject.hbs (optional)
html.hbs
text.hbs (optional)
password_reset/
subject.hbs
html.hbs
text.hbsSourcepub fn register_helper<H: HelperDef + Send + Sync + 'static>(
self,
name: &str,
helper: H,
) -> Self
pub fn register_helper<H: HelperDef + Send + Sync + 'static>( self, name: &str, helper: H, ) -> Self
Register helpers.
Sourcepub fn register_partial(self, name: &str, content: &str) -> Result<Self>
pub fn register_partial(self, name: &str, content: &str) -> Result<Self>
Register a partial template.
Trait Implementations§
Source§impl Default for HandlebarsEngine
impl Default for HandlebarsEngine
Source§impl TemplateEngine for HandlebarsEngine
impl TemplateEngine for HandlebarsEngine
Auto Trait Implementations§
impl Freeze for HandlebarsEngine
impl !RefUnwindSafe for HandlebarsEngine
impl Send for HandlebarsEngine
impl Sync for HandlebarsEngine
impl Unpin for HandlebarsEngine
impl !UnwindSafe for HandlebarsEngine
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