ElementPath

Struct ElementPath 

Source
pub struct ElementPath { /* private fields */ }
Expand description

A path to a particular child Element.

Implementations§

Source§

impl ElementPath

Source

pub const EMPTY: &ElementPath

An empty element path.

Source

pub const fn from_slice<'p>(slice: &'p [ElementSelector]) -> &'p Self

Create an ElementPath ref from a slice of ElementSelector.

Source

pub fn from_mut_slice<'p>(slice: &'p mut [ElementSelector]) -> &'p mut Self

Create a mut ElementPath ref from a mut slice of ElementSelector.

Source

pub const fn len(&self) -> usize

Gets the number of selectors in this ElementPath.

Source

pub fn to_buf(&self) -> ElementPathBuf

Creates an ElementPathBuf from this ElementPath.

Source

pub const fn as_slice(&self) -> &[ElementSelector]

Get this ElementPath as a slice.

Source

pub fn as_mut_slice(&mut self) -> &mut [ElementSelector]

Get this ElementPath as a mutable slice.

Source

pub fn iter(&self) -> Iter<'_, ElementSelector>

Get an iterator over the selectors in this path.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, ElementSelector>

Get an iterator over mutable selectors in this path.

Source

pub const fn parent(&self) -> Option<&ElementPath>

Get the parent of this ElementPath if any. Returns None for the root (empty) path.

Source

pub const fn last(&self) -> Option<ElementSelector>

Gets the last selector from the ElementPath.

Source

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

Source§

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

Source§

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

Source§

fn as_ref(&self) -> &[ElementSelector]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ElementPath> for ElementPathBuf

Source§

fn as_ref(&self) -> &ElementPath

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<ElementPath> for ElementPathBuf

Source§

fn borrow(&self) -> &ElementPath

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ElementPath> for ElementSelector

Source§

fn borrow(&self) -> &ElementPath

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<ElementPath> for ElementPathBuf

Source§

fn borrow_mut(&mut self) -> &mut ElementPath

Mutably borrows from an owned value. Read more
Source§

impl BorrowMut<ElementPath> for ElementSelector

Source§

fn borrow_mut(&mut self) -> &mut ElementPath

Mutably borrows from an owned value. Read more
Source§

impl Debug for ElementPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'p> ElementIndex for &'p ElementPath

Source§

impl<'p> ElementIndex for &'p mut ElementPath

Source§

impl Hash for ElementPath

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
Source§

impl<'p> IntoIterator for &'p ElementPath

Source§

type IntoIter = Iter<'p, ElementSelector>

Which kind of iterator are we turning this into?
Source§

type Item = &'p ElementSelector

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'p> IntoIterator for &'p mut ElementPath

Source§

type IntoIter = IterMut<'p, ElementSelector>

Which kind of iterator are we turning this into?
Source§

type Item = &'p mut ElementSelector

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Ord for ElementPath

Source§

fn cmp(&self, other: &ElementPath) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq<&ElementPath> for ElementPathBuf

Source§

fn eq(&self, other: &&ElementPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<&mut ElementPath> for ElementPathBuf

Source§

fn eq(&self, other: &&mut ElementPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<ElementPath> for ElementPathBuf

Source§

fn eq(&self, other: &ElementPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<ElementPathBuf> for &ElementPath

Source§

fn eq(&self, other: &ElementPathBuf) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<ElementPathBuf> for &mut ElementPath

Source§

fn eq(&self, other: &ElementPathBuf) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<ElementPathBuf> for ElementPath

Source§

fn eq(&self, other: &ElementPathBuf) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for ElementPath

Source§

fn eq(&self, other: &ElementPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ElementPath

Source§

fn partial_cmp(&self, other: &ElementPath) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToOwned for ElementPath

Source§

type Owned = ElementPathBuf

The resulting type after obtaining ownership.
Source§

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)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl Eq for ElementPath

Source§

impl StructuralPartialEq for ElementPath

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more