pub struct FunctionRegistry { /* private fields */ }Expand description
Function registry for managing custom functions and filters
Provides a centralized way to register and manage custom template extensions
Implementations§
Source§impl FunctionRegistry
impl FunctionRegistry
Sourcepub fn add_function<F>(self, func: CustomFunction<F>) -> Self
pub fn add_function<F>(self, func: CustomFunction<F>) -> Self
Add custom function
Sourcepub fn add_filter<F>(self, filter: CustomFilter<F>) -> Self
pub fn add_filter<F>(self, filter: CustomFilter<F>) -> Self
Add custom filter
Sourcepub fn register_all(&self, _tera: &mut Tera) -> Result<()>
pub fn register_all(&self, _tera: &mut Tera) -> Result<()>
Sourcepub fn function_count(&self) -> usize
pub fn function_count(&self) -> usize
Get number of registered functions
Sourcepub fn filter_count(&self) -> usize
pub fn filter_count(&self) -> usize
Get number of registered filters
Trait Implementations§
Source§impl Default for FunctionRegistry
impl Default for FunctionRegistry
Source§fn default() -> FunctionRegistry
fn default() -> FunctionRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FunctionRegistry
impl !RefUnwindSafe for FunctionRegistry
impl Send for FunctionRegistry
impl Sync for FunctionRegistry
impl Unpin for FunctionRegistry
impl !UnwindSafe for FunctionRegistry
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