pub struct Path { /* private fields */ }Expand description
Represents a path in a document tree.
Implementations§
Source§impl Path
impl Path
Sourcepub fn get(&self, idx: usize) -> Option<&PathComponent>
pub fn get(&self, idx: usize) -> Option<&PathComponent>
Returns the idxth path component, if any.
Sourcepub fn iter(&self) -> impl Iterator<Item = &PathComponent>
pub fn iter(&self) -> impl Iterator<Item = &PathComponent>
Iterates over the path’s components.
Sourcepub fn push(&mut self, component: PathComponent)
pub fn push(&mut self, component: PathComponent)
Appends a path component.
Sourcepub fn pop(&mut self) -> Option<PathComponent>
pub fn pop(&mut self) -> Option<PathComponent>
Removes and returns the last path component, if any.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Path
impl Freeze for Path
impl Move for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnsafeUnpin for Path
impl UnwindSafe for Path
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