pub struct TemplatePath { /* private fields */ }Expand description
A compact path from a template root to a static node or dynamic attribute.
Implementations§
Source§impl TemplatePath
impl TemplatePath
Sourcepub const fn next_child(self) -> Self
pub const fn next_child(self) -> Self
Return the path for the first child of this path.
Sourcepub const fn next_sibling(self) -> Self
pub const fn next_sibling(self) -> Self
Return the path for the next sibling of this path.
Sourcepub const fn split_insertion(self) -> (TemplatePath, usize)
pub const fn split_insertion(self) -> (TemplatePath, usize)
Split a path to a static node into its parent path and the node’s index among that parent’s children.
Sourcepub const fn is_root(self) -> bool
pub const fn is_root(self) -> bool
Return true if this path points at a template root node (a direct child of the root).
Sourcepub const fn depth(self) -> usize
pub const fn depth(self) -> usize
Return the number of path segments from the template root to this path.
Sourcepub fn segments(self) -> TemplatePathSegments
pub fn segments(self) -> TemplatePathSegments
Iterate sibling indexes from the root to this path.
Sourcepub fn starts_with(self, ancestor: TemplatePath) -> bool
pub fn starts_with(self, ancestor: TemplatePath) -> bool
Return true if this compact path starts with ancestor.
Trait Implementations§
Source§impl Clone for TemplatePath
impl Clone for TemplatePath
impl Copy for TemplatePath
impl Eq for TemplatePath
Source§impl Hash for TemplatePath
impl Hash for TemplatePath
Source§impl Ord for TemplatePath
impl Ord for TemplatePath
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for TemplatePath
impl PartialEq for TemplatePath
Source§impl PartialOrd for TemplatePath
impl PartialOrd for TemplatePath
impl StructuralPartialEq for TemplatePath
Auto Trait Implementations§
impl Freeze for TemplatePath
impl RefUnwindSafe for TemplatePath
impl Send for TemplatePath
impl Sync for TemplatePath
impl Unpin for TemplatePath
impl UnsafeUnpin for TemplatePath
impl UnwindSafe for TemplatePath
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