pub enum Engine {
Simple,
}
Expand description
Supported template engines for processing templates.
Each engine provides different features and syntax:
- Simple: Basic
{variable}
substitution - Handlebars: Full Handlebars templating with helpers and conditionals
- Tera: Jinja2-like templating with filters and inheritance
- MiniJinja: Lightweight Jinja2 implementation
§Examples
ⓘ
use tomplate_build::Engine;
// Use in Builder
Builder::new()
.default_engine(Engine::Handlebars)
.build()?;
§Feature Flags
Some engines require feature flags to be enabled:
handlebars
: Enables the Handlebars enginetera
: Enables the Tera engineminijinja
: Enables the MiniJinja engine
Variants§
Simple
Simple variable substitution engine.
Uses {variable}
syntax for placeholders.
This is the default engine and requires no additional features.
§Example Template
Hello {name}, you have {count} messages.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Engine
impl<'de> Deserialize<'de> for Engine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Engine
impl Eq for Engine
impl StructuralPartialEq for Engine
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnwindSafe for Engine
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.