pub enum TemplateElement {
Text(String),
Placeholder(String),
Conditional {
condition: String,
content: Vec<TemplateElement>,
},
Loop {
variable: String,
content: Vec<TemplateElement>,
},
Include(String),
}Expand description
Represents a parsed template element
Variants§
Text(String)
Plain text content
Placeholder(String)
Placeholder: {{name}} or {{Name}} or {{name_snake}} etc.
Conditional
Conditional block: {{#if condition}}…{{/if}}
Fields
§
content: Vec<TemplateElement>Content inside the conditional
Loop
Loop block: {{#each items}}…{{/each}}
Fields
§
content: Vec<TemplateElement>Content inside the loop
Include(String)
Include/partial: {{> partial_name}}
Trait Implementations§
Source§impl Clone for TemplateElement
impl Clone for TemplateElement
Source§fn clone(&self) -> TemplateElement
fn clone(&self) -> TemplateElement
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 TemplateElement
impl Debug for TemplateElement
Source§impl PartialEq for TemplateElement
impl PartialEq for TemplateElement
impl Eq for TemplateElement
impl StructuralPartialEq for TemplateElement
Auto Trait Implementations§
impl Freeze for TemplateElement
impl RefUnwindSafe for TemplateElement
impl Send for TemplateElement
impl Sync for TemplateElement
impl Unpin for TemplateElement
impl UnwindSafe for TemplateElement
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.