pub enum TemplateTree {
Template(Template),
Mapping(Arc<BTreeMap<InnerData, TemplateTree>>),
Sequence(Arc<Vec<TemplateTree>>),
}Expand description
TemplateTree holds the parsed result of a InnerData tree. This tree of templates can then be loaded directly into a context.
Variants§
Template(Template)
This TemplateTree node contains a template. This node type can be converted into a Template
Mapping(Arc<BTreeMap<InnerData, TemplateTree>>)
This TemplateTree node contains a mapping
Sequence(Arc<Vec<TemplateTree>>)
This TemplateTree node contains a sequence
Implementations§
Source§impl TemplateTree
impl TemplateTree
Sourcepub fn get(&self, key: &InnerData) -> Option<TemplateTree>
pub fn get(&self, key: &InnerData) -> Option<TemplateTree>
Attempt to walk the tree with the specified key
Sourcepub fn get_path<T: Into<InnerData> + Clone>(
&self,
path: &[T],
) -> Option<TemplateTree>
pub fn get_path<T: Into<InnerData> + Clone>( &self, path: &[T], ) -> Option<TemplateTree>
Attempt to walk the tree with the specified path
Sourcepub fn get_index(&self, index: usize) -> Option<TemplateTree>
pub fn get_index(&self, index: usize) -> Option<TemplateTree>
Attempt to retrieve an index from a sequence of the tree
Trait Implementations§
Source§impl Clone for TemplateTree
impl Clone for TemplateTree
Source§fn clone(&self) -> TemplateTree
fn clone(&self) -> TemplateTree
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 TemplateTree
impl Debug for TemplateTree
Source§impl Default for TemplateTree
impl Default for TemplateTree
Source§impl From<Template> for TemplateTree
impl From<Template> for TemplateTree
Source§fn from(t: Template) -> TemplateTree
fn from(t: Template) -> TemplateTree
Converts to this type from the input type.
Source§impl TryFrom<TemplateTree> for Template
impl TryFrom<TemplateTree> for Template
Source§type Error = TemplarError
type Error = TemplarError
The type returned in the event of a conversion error.
Source§fn try_from(value: TemplateTree) -> Result<Self>
fn try_from(value: TemplateTree) -> Result<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for TemplateTree
impl !RefUnwindSafe for TemplateTree
impl Send for TemplateTree
impl Sync for TemplateTree
impl Unpin for TemplateTree
impl UnsafeUnpin for TemplateTree
impl !UnwindSafe for TemplateTree
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