pub struct Atom { /* private fields */ }Implementations§
Source§impl Atom
impl Atom
pub fn new() -> Self
pub fn load_templates(&mut self, glob_pattern: &str) -> Result<(), Error>
pub fn add_template(&mut self, name: &str, content: &str) -> Result<(), Error>
pub fn register_component( &mut self, path: &str, template: &str, ) -> Result<(), Error>
pub fn register_filter<F>(&mut self, name: &str, filter: F)
pub fn register_function<F>(&mut self, name: &str, function: F)
pub fn set_max_loop_iter(&mut self, max: usize)
pub fn set_debug(&mut self, debug: bool)
pub fn render(&self, template: &str, context: &Value) -> Result<String, Error>
pub fn render_with_components( &self, template: &str, context: &Value, component_data: &Value, ) -> Result<String, Error>
pub fn provide(&mut self, key: &str, value: Value)
pub fn reload(&mut self) -> Result<(), Error>
pub fn template_exists(&self, name: &str) -> bool
pub fn get_registered_templates(&self) -> Vec<String>
pub fn clear_cache(&mut self)
pub fn set_parallel(&mut self, enabled: bool)
pub fn is_parallel(&self) -> bool
pub fn enable_component_cache(&mut self, enabled: bool)
pub fn is_component_cache_enabled(&self) -> bool
pub fn clear_component_cache(&mut self)
pub fn component_cache_len(&self) -> usize
pub fn render_many( &self, templates: &[(&str, &Value)], ) -> Result<Vec<(String, String)>, Error>
pub async fn render_async( &self, template: &str, context: &Value, ) -> Result<String, Error>
pub async fn render_many_async( &self, templates: &[(&str, &Value)], ) -> Result<Vec<(String, String)>, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Atom
impl !RefUnwindSafe for Atom
impl Send for Atom
impl Sync for Atom
impl Unpin for Atom
impl UnsafeUnpin for Atom
impl !UnwindSafe for Atom
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more