Struct handlebars_iron::HandlebarsEngine [−][src]
pub struct HandlebarsEngine { pub sources: Vec<Box<Source + Send + Sync>>, pub registry: RwLock<Box<Handlebars>>, }
The handlebars template engine
Fields
sources: Vec<Box<Source + Send + Sync>>
registry: RwLock<Box<Handlebars>>
Methods
impl HandlebarsEngine
[src]
impl HandlebarsEngine
pub fn new() -> HandlebarsEngine
[src]
pub fn new() -> HandlebarsEngine
create a handlebars template engine
pub fn from(reg: Handlebars) -> HandlebarsEngine
[src]
pub fn from(reg: Handlebars) -> HandlebarsEngine
create a handlebars template engine from existed handlebars registry
pub fn add(&mut self, source: Box<Source + Send + Sync>)
[src]
pub fn add(&mut self, source: Box<Source + Send + Sync>)
add a template source
pub fn reload(&self) -> Result<(), SourceError>
[src]
pub fn reload(&self) -> Result<(), SourceError>
load template from registered sources
pub fn handlebars_mut(&self) -> RwLockWriteGuard<Box<Handlebars>>
[src]
pub fn handlebars_mut(&self) -> RwLockWriteGuard<Box<Handlebars>>
access internal handlebars registry, useful to register custom helpers
Trait Implementations
impl Key for HandlebarsEngine
[src]
impl Key for HandlebarsEngine
impl PluginFor<Response> for HandlebarsEngine
[src]
impl PluginFor<Response> for HandlebarsEngine
type Error = ()
The error type associated with this plugin.
fn eval(resp: &mut Response) -> Result<Template, ()>
[src]
fn eval(resp: &mut Response) -> Result<Template, ()>
Create the plugin from an instance of the extended type. Read more
impl AfterMiddleware for HandlebarsEngine
[src]
impl AfterMiddleware for HandlebarsEngine
fn after(&self, _: &mut Request, resp: Response) -> IronResult<Response>
[src]
fn after(&self, _: &mut Request, resp: Response) -> IronResult<Response>
Do whatever post-processing this middleware should do.
fn catch(&self, req: &mut Request, err: IronError) -> IronResult<Response>
[src]
fn catch(&self, req: &mut Request, err: IronError) -> IronResult<Response>
Respond to an error thrown by previous AfterMiddleware
, the Handler
, or a BeforeMiddleware
. Read more
Auto Trait Implementations
impl Send for HandlebarsEngine
impl Send for HandlebarsEngine
impl Sync for HandlebarsEngine
impl Sync for HandlebarsEngine