[][src]Struct handlebars_iron::HandlebarsEngine

pub struct HandlebarsEngine {
    pub sources: Vec<Box<dyn Source + Send + Sync>>,
    pub registry: RwLock<Box<Handlebars<'static>>>,
}

The handlebars template engine

Fields

sources: Vec<Box<dyn Source + Send + Sync>>registry: RwLock<Box<Handlebars<'static>>>

Methods

impl HandlebarsEngine[src]

pub fn new() -> HandlebarsEngine[src]

create a handlebars template engine

pub fn from(reg: Handlebars<'static>) -> HandlebarsEngine[src]

create a handlebars template engine from existed handlebars registry

pub fn add(&mut self, source: Box<dyn Source + Send + Sync>)[src]

add a template source

pub fn reload(&self) -> Result<(), SourceError>[src]

load template from registered sources

pub fn handlebars_mut(&self) -> RwLockWriteGuard<Box<Handlebars<'static>>>[src]

access internal handlebars registry, useful to register custom helpers

Trait Implementations

impl AfterMiddleware for HandlebarsEngine[src]

impl Key for HandlebarsEngine[src]

type Value = Template

The value type associated with this key type.

impl Plugin<Response> for HandlebarsEngine[src]

type Error = ()

The error type associated with this plugin.

Auto Trait Implementations

Blanket Implementations

impl<F> AfterMiddleware for F where
    F: Send + Sync + 'static + Fn(&mut Request, Response) -> Result<Response, IronError>, 
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any