pub struct TemplateEngine { /* private fields */ }
Expand description
Template engine for processing template strings with various token types
Implementations§
Source§impl TemplateEngine
impl TemplateEngine
Sourcepub fn new_with_config(
config: Config,
) -> Result<Self, Box<dyn Error + Send + Sync>>
pub fn new_with_config( config: Config, ) -> Result<Self, Box<dyn Error + Send + Sync>>
Create a new template engine with configuration
Sourcepub fn expand_str(&self, input: &str) -> String
pub fn expand_str(&self, input: &str) -> String
Expand templating tokens in a string
Sourcepub fn expand_str_with_context(
&self,
input: &str,
context: &TemplatingContext,
) -> String
pub fn expand_str_with_context( &self, input: &str, context: &TemplatingContext, ) -> String
Expand templating tokens in a string with context
Sourcepub fn expand_tokens(&self, value: &Value) -> Value
pub fn expand_tokens(&self, value: &Value) -> Value
Expand templating tokens in a JSON value
Sourcepub fn expand_tokens_with_context(
&self,
value: &Value,
context: &TemplatingContext,
) -> Value
pub fn expand_tokens_with_context( &self, value: &Value, context: &TemplatingContext, ) -> Value
Expand templating tokens in a JSON value with context
Trait Implementations§
Source§impl Clone for TemplateEngine
impl Clone for TemplateEngine
Source§fn clone(&self) -> TemplateEngine
fn clone(&self) -> TemplateEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TemplateEngine
impl Debug for TemplateEngine
Auto Trait Implementations§
impl Freeze for TemplateEngine
impl RefUnwindSafe for TemplateEngine
impl Send for TemplateEngine
impl Sync for TemplateEngine
impl Unpin for TemplateEngine
impl UnwindSafe for TemplateEngine
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