[][src]Struct templar::TemplarBuilder

pub struct TemplarBuilder { /* fields omitted */ }

Use TemplarBuilder for creating a new customized instance of Templar.

Usage

let builder = TemplarBuilder::default(); // Default filters/functions preloaded
let templar = builder.build();

Implementations

impl TemplarBuilder[src]

pub fn new() -> TemplarBuilder[src]

Create a new empty context with no filters or functions. Generally, you should be using the default context.

pub fn add_function<T: 'static + Fn(Data) -> Data + Send + Sync>(
    &mut self,
    name: &str,
    val: T
) -> &mut Self
[src]

Add a function to the configuration with the name specified

pub fn remove_function(&mut self, name: &str) -> &mut Self[src]

Remove the specified function name from the configuration

pub fn add_filter<T: 'static + Fn(Data, Data) -> Data + Send + Sync>(
    &mut self,
    name: &str,
    val: T
) -> &mut Self
[src]

Add a filter to the configuration with the specified signature

pub fn remove_filter(&mut self, name: &str) -> &mut Self[src]

Remove the specified filter name from the configuration

pub fn build(self) -> Templar[src]

Build a new templar instance with this configuration

Trait Implementations

impl Default for TemplarBuilder[src]

Auto Trait Implementations

Blanket Implementations

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.