pub struct HandlebarsEngine {
pub sources: Vec<Box<dyn Source + Send + Sync>>,
pub registry: RwLock<Box<Handlebars<'static>>>,
}Expand description
The handlebars template engine
Fields§
§sources: Vec<Box<dyn Source + Send + Sync>>§registry: RwLock<Box<Handlebars<'static>>>Implementations§
Source§impl HandlebarsEngine
impl HandlebarsEngine
Sourcepub fn new() -> HandlebarsEngine
pub fn new() -> HandlebarsEngine
create a handlebars template engine
Sourcepub fn from(reg: Handlebars<'static>) -> HandlebarsEngine
pub fn from(reg: Handlebars<'static>) -> HandlebarsEngine
create a handlebars template engine from existed handlebars registry
Sourcepub fn reload(&self) -> Result<(), SourceError>
pub fn reload(&self) -> Result<(), SourceError>
load template from registered sources
Sourcepub fn handlebars_mut(&self) -> RwLockWriteGuard<'_, Box<Handlebars<'static>>>
pub fn handlebars_mut(&self) -> RwLockWriteGuard<'_, Box<Handlebars<'static>>>
access internal handlebars registry, useful to register custom helpers
Trait Implementations§
Source§impl AfterMiddleware for HandlebarsEngine
impl AfterMiddleware for HandlebarsEngine
Source§impl Key for HandlebarsEngine
impl Key for HandlebarsEngine
Auto Trait Implementations§
impl !Freeze for HandlebarsEngine
impl !RefUnwindSafe for HandlebarsEngine
impl !UnwindSafe for HandlebarsEngine
impl Send for HandlebarsEngine
impl Sync for HandlebarsEngine
impl Unpin for HandlebarsEngine
impl UnsafeUnpin 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