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]
fn new() -> HandlebarsEngine
create a handlebars template engine
fn from(reg: Handlebars) -> HandlebarsEngine
create a handlebars template engine from existed handlebars registry
fn add(&mut self, source: Box<Source + Send + Sync>)
add a template source
fn reload(&self) -> Result<(), SourceError>
load template from registered sources
fn handlebars_mut(&self) -> RwLockWriteGuard<Box<Handlebars>>
access internal handlebars registry, useful to register custom helpers
Trait Implementations
impl Key for HandlebarsEngine
[src]
impl PluginFor<Response> for HandlebarsEngine
[src]
type Error = ()
The error type associated with this plugin.
fn eval(resp: &mut Response) -> Result<Template, ()>
Create the plugin from an instance of the extended type. Read more
impl AfterMiddleware for HandlebarsEngine
[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>
Respond to an error thrown by previous AfterMiddleware
, the Handler
, or a BeforeMiddleware
. Read more