[][src]Struct handlebars_iron::HandlebarsEngine

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

The handlebars template engine

Fields

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

Methods

impl HandlebarsEngine[src]

pub fn new() -> HandlebarsEngine[src]

create a handlebars template engine

pub fn from(reg: Handlebars) -> 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>>[src]

access internal handlebars registry, useful to register custom helpers

Trait Implementations

impl Key for HandlebarsEngine[src]

type Value = Template

The value type associated with this key type.

impl AfterMiddleware for HandlebarsEngine[src]

impl Plugin<Response> for HandlebarsEngine[src]

type Error = ()

The error type associated with this plugin.

Auto Trait Implementations

impl Send for HandlebarsEngine

impl Unpin for HandlebarsEngine

impl Sync for HandlebarsEngine

impl !UnwindSafe for HandlebarsEngine

impl !RefUnwindSafe for HandlebarsEngine

Blanket Implementations

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

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

fn catch(&self, &mut Request, err: IronError) -> Result<Response, IronError>[src]

Respond to an error thrown by previous AfterMiddleware, the Handler, or a BeforeMiddleware. Read more

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> UnsafeAny for T where
    T: Any