pub struct ElementPath { /* private fields */ }Expand description
A path to a particular child Element.
Implementations§
Source§impl ElementPath
impl ElementPath
Sourcepub const EMPTY: &ElementPath
pub const EMPTY: &ElementPath
An empty element path.
Sourcepub const fn from_slice<'p>(slice: &'p [ElementSelector]) -> &'p Self
pub const fn from_slice<'p>(slice: &'p [ElementSelector]) -> &'p Self
Create an ElementPath ref from a slice of ElementSelector.
Sourcepub fn from_mut_slice<'p>(slice: &'p mut [ElementSelector]) -> &'p mut Self
pub fn from_mut_slice<'p>(slice: &'p mut [ElementSelector]) -> &'p mut Self
Create a mut ElementPath ref from a mut slice of ElementSelector.
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Gets the number of selectors in this ElementPath.
Sourcepub fn to_buf(&self) -> ElementPathBuf
pub fn to_buf(&self) -> ElementPathBuf
Creates an ElementPathBuf from this ElementPath.
Sourcepub const fn as_slice(&self) -> &[ElementSelector]
pub const fn as_slice(&self) -> &[ElementSelector]
Get this ElementPath as a slice.
Sourcepub fn as_mut_slice(&mut self) -> &mut [ElementSelector]
pub fn as_mut_slice(&mut self) -> &mut [ElementSelector]
Get this ElementPath as a mutable slice.
Sourcepub fn iter(&self) -> Iter<'_, ElementSelector>
pub fn iter(&self) -> Iter<'_, ElementSelector>
Get an iterator over the selectors in this path.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, ElementSelector>
pub fn iter_mut(&mut self) -> IterMut<'_, ElementSelector>
Get an iterator over mutable selectors in this path.
Sourcepub const fn parent(&self) -> Option<&ElementPath>
pub const fn parent(&self) -> Option<&ElementPath>
Get the parent of this ElementPath if any. Returns None for the root (empty)
path.
Sourcepub const fn last(&self) -> Option<ElementSelector>
pub const fn last(&self) -> Option<ElementSelector>
Gets the last selector from the ElementPath.
Sourcepub fn last_mut(&mut self) -> Option<&mut ElementSelector>
pub fn last_mut(&mut self) -> Option<&mut ElementSelector>
Mutably gets the last selector from the ElementPath.
Trait Implementations§
Source§impl AsMut<[ElementSelector]> for ElementPath
impl AsMut<[ElementSelector]> for ElementPath
Source§fn as_mut(&mut self) -> &mut [ElementSelector]
fn as_mut(&mut self) -> &mut [ElementSelector]
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsMut<ElementPath> for ElementPathBuf
impl AsMut<ElementPath> for ElementPathBuf
Source§fn as_mut(&mut self) -> &mut ElementPath
fn as_mut(&mut self) -> &mut ElementPath
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<[ElementSelector]> for ElementPath
impl AsRef<[ElementSelector]> for ElementPath
Source§fn as_ref(&self) -> &[ElementSelector]
fn as_ref(&self) -> &[ElementSelector]
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<ElementPath> for ElementPathBuf
impl AsRef<ElementPath> for ElementPathBuf
Source§fn as_ref(&self) -> &ElementPath
fn as_ref(&self) -> &ElementPath
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<ElementPath> for ElementPathBuf
impl Borrow<ElementPath> for ElementPathBuf
Source§fn borrow(&self) -> &ElementPath
fn borrow(&self) -> &ElementPath
Immutably borrows from an owned value. Read more
Source§impl Borrow<ElementPath> for ElementSelector
impl Borrow<ElementPath> for ElementSelector
Source§fn borrow(&self) -> &ElementPath
fn borrow(&self) -> &ElementPath
Immutably borrows from an owned value. Read more
Source§impl BorrowMut<ElementPath> for ElementPathBuf
impl BorrowMut<ElementPath> for ElementPathBuf
Source§fn borrow_mut(&mut self) -> &mut ElementPath
fn borrow_mut(&mut self) -> &mut ElementPath
Mutably borrows from an owned value. Read more
Source§impl BorrowMut<ElementPath> for ElementSelector
impl BorrowMut<ElementPath> for ElementSelector
Source§fn borrow_mut(&mut self) -> &mut ElementPath
fn borrow_mut(&mut self) -> &mut ElementPath
Mutably borrows from an owned value. Read more
Source§impl Debug for ElementPath
impl Debug for ElementPath
Source§impl<'p> ElementIndex for &'p ElementPath
impl<'p> ElementIndex for &'p ElementPath
type PathSelectors = Copied<Iter<'p, ElementSelector>>
fn path_selectors(self) -> Self::PathSelectors
Source§impl<'p> ElementIndex for &'p mut ElementPath
impl<'p> ElementIndex for &'p mut ElementPath
type PathSelectors = Copied<Iter<'p, ElementSelector>>
fn path_selectors(self) -> Self::PathSelectors
Source§impl Hash for ElementPath
impl Hash for ElementPath
Source§impl<'p> IntoIterator for &'p ElementPath
impl<'p> IntoIterator for &'p ElementPath
Source§impl<'p> IntoIterator for &'p mut ElementPath
impl<'p> IntoIterator for &'p mut ElementPath
Source§impl Ord for ElementPath
impl Ord for ElementPath
Source§impl PartialEq<&ElementPath> for ElementPathBuf
impl PartialEq<&ElementPath> for ElementPathBuf
Source§impl PartialEq<&mut ElementPath> for ElementPathBuf
impl PartialEq<&mut ElementPath> for ElementPathBuf
Source§impl PartialEq<ElementPath> for ElementPathBuf
impl PartialEq<ElementPath> for ElementPathBuf
Source§impl PartialEq<ElementPathBuf> for &ElementPath
impl PartialEq<ElementPathBuf> for &ElementPath
Source§impl PartialEq<ElementPathBuf> for &mut ElementPath
impl PartialEq<ElementPathBuf> for &mut ElementPath
Source§impl PartialEq<ElementPathBuf> for ElementPath
impl PartialEq<ElementPathBuf> for ElementPath
Source§impl PartialEq for ElementPath
impl PartialEq for ElementPath
Source§impl PartialOrd for ElementPath
impl PartialOrd for ElementPath
Source§impl ToOwned for ElementPath
impl ToOwned for ElementPath
Source§type Owned = ElementPathBuf
type Owned = ElementPathBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more