ElementPathBuf

Struct ElementPathBuf 

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

A path to a particular child Element.

Implementations§

Source§

impl ElementPathBuf

Source

pub fn new() -> Self

Create a new empty element path buf.

Source

pub fn from_path(path: &ElementPath) -> Self

Create a new selector by copying the given path.

Source

pub fn as_path(&self) -> &ElementPath

Get this ElementPathBuf as an ElementPath slice.

Source

pub fn as_mut_path(&mut self) -> &mut ElementPath

Get this ElementPathBuf as a mut ElementPath slice.

Source

pub fn push<S>(&mut self, selector: S)

Push the given selector onto the end of this path.

Source

pub fn append<P>(&mut self, path: P)
where P: ElementIndex,

Append another ElementIndex to the end of this path.

Source

pub fn pop(&mut self) -> Option<ElementSelector>

Pop the last element off of this path selector, transforming it into its parent. Returns the ElementSelector that was popped, or None if the path was already the root.

Methods from Deref<Target = ElementPath>§

Source

pub const EMPTY: &ElementPath

Source

pub 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 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 fn parent(&self) -> Option<&ElementPath>

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

Source

pub 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 ElementPathBuf

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 ElementPathBuf

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 BorrowMut<ElementPath> for ElementPathBuf

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl Clone for ElementPathBuf

Source§

fn clone(&self) -> ElementPathBuf

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ElementPathBuf

Source§

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

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

impl Default for ElementPathBuf

Source§

fn default() -> ElementPathBuf

Returns the “default value” for a type. Read more
Source§

impl Deref for ElementPathBuf

Source§

type Target = ElementPath

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for ElementPathBuf

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'p> ElementIndex for &'p ElementPathBuf

Source§

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

Source§

impl<'p> ElementIndex for ElementPathBuf

Source§

impl Hash for ElementPathBuf

Source§

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

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

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'p> IntoIterator for &'p ElementPathBuf

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 ElementPathBuf

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 IntoIterator for ElementPathBuf

Source§

type IntoIter = IntoIter<ElementSelector>

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

type Item = 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 ElementPathBuf

Source§

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

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

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. 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 ElementPathBuf

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 PartialOrd for ElementPathBuf

Source§

fn partial_cmp(&self, other: &ElementPathBuf) -> 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 Eq for ElementPathBuf

Source§

impl StructuralPartialEq for ElementPathBuf

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.