pub struct TemplarBuilder { /* private fields */ }Expand description
Use TemplarBuilder for creating a new customized instance of Templar.
§Usage
let builder = TemplarBuilder::default(); // Default filters/functions preloaded
let templar = builder.build();Implementations§
Source§impl TemplarBuilder
impl TemplarBuilder
Sourcepub fn new() -> TemplarBuilder
pub fn new() -> TemplarBuilder
Create a new empty context with no filters or functions. Generally, you should be using the default context.
Sourcepub fn add_function<T: 'static + Fn(Data) -> Data + Send + Sync>(
&mut self,
name: &str,
val: T,
) -> &mut Self
pub fn add_function<T: 'static + Fn(Data) -> Data + Send + Sync>( &mut self, name: &str, val: T, ) -> &mut Self
Add a function to the configuration with the name specified
Sourcepub fn remove_function(&mut self, name: &str) -> &mut Self
pub fn remove_function(&mut self, name: &str) -> &mut Self
Remove the specified function name from the configuration
Sourcepub fn add_filter<T: 'static + Fn(Data, Data) -> Data + Send + Sync>(
&mut self,
name: &str,
val: T,
) -> &mut Self
pub fn add_filter<T: 'static + Fn(Data, Data) -> Data + Send + Sync>( &mut self, name: &str, val: T, ) -> &mut Self
Add a filter to the configuration with the specified signature
Sourcepub fn remove_filter(&mut self, name: &str) -> &mut Self
pub fn remove_filter(&mut self, name: &str) -> &mut Self
Remove the specified filter name from the configuration
Trait Implementations§
Source§impl Default for TemplarBuilder
impl Default for TemplarBuilder
Source§fn default() -> TemplarBuilder
fn default() -> TemplarBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TemplarBuilder
impl !RefUnwindSafe for TemplarBuilder
impl Send for TemplarBuilder
impl Sync for TemplarBuilder
impl Unpin for TemplarBuilder
impl UnsafeUnpin for TemplarBuilder
impl !UnwindSafe for TemplarBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more