[−][src]Struct templar::TemplarBuilder
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]
&mut self,
name: &str,
val: T
) -> &mut Self
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]
&mut self,
name: &str,
val: T
) -> &mut Self
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]
pub fn default() -> TemplarBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TemplarBuilder
[src]
impl Send for TemplarBuilder
[src]
impl Sync for TemplarBuilder
[src]
impl Unpin for TemplarBuilder
[src]
impl !UnwindSafe for TemplarBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,