pub struct NormalizedPath<'a>(/* private fields */);
Implementations§
Source§impl<'a> NormalizedPath<'a>
impl<'a> NormalizedPath<'a>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Check if the NormalizedPath
is empty
An empty normalized path represents the location of the root node of the object,
i.e., $
.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the length of the NormalizedPath
Sourcepub fn iter(&self) -> Iter<'_, PathElement<'a>>
pub fn iter(&self) -> Iter<'_, PathElement<'a>>
Get an iterator over the PathElement
s of the NormalizedPath
Note that NormalizedPath
also implements IntoIterator
Sourcepub fn get<I>(&self, index: I) -> Option<&I::Output>where
I: SliceIndex<[PathElement<'a>]>,
pub fn get<I>(&self, index: I) -> Option<&I::Output>where
I: SliceIndex<[PathElement<'a>]>,
Get the PathElement
at index
, or None
if the index is out of bounds
Sourcepub fn first(&self) -> Option<&PathElement<'a>>
pub fn first(&self) -> Option<&PathElement<'a>>
Get the first PathElement
, or None
if the path is empty
Sourcepub fn last(&self) -> Option<&PathElement<'a>>
pub fn last(&self) -> Option<&PathElement<'a>>
Get the last PathElement
, or None
if the path is empty
Trait Implementations§
Source§impl<'a> Clone for NormalizedPath<'a>
impl<'a> Clone for NormalizedPath<'a>
Source§fn clone(&self) -> NormalizedPath<'a>
fn clone(&self) -> NormalizedPath<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for NormalizedPath<'a>
impl<'a> Debug for NormalizedPath<'a>
Source§impl<'a> Default for NormalizedPath<'a>
impl<'a> Default for NormalizedPath<'a>
Source§fn default() -> NormalizedPath<'a>
fn default() -> NormalizedPath<'a>
Returns the “default value” for a type. Read more
Source§impl Display for NormalizedPath<'_>
impl Display for NormalizedPath<'_>
Source§impl<'a> IntoIterator for NormalizedPath<'a>
impl<'a> IntoIterator for NormalizedPath<'a>
Source§impl<'a> Ord for NormalizedPath<'a>
impl<'a> Ord for NormalizedPath<'a>
Source§fn cmp(&self, other: &NormalizedPath<'a>) -> Ordering
fn cmp(&self, other: &NormalizedPath<'a>) -> Ordering
1.21.0 · 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
Source§impl<'a> PartialEq for NormalizedPath<'a>
impl<'a> PartialEq for NormalizedPath<'a>
Source§impl<'a> PartialOrd for NormalizedPath<'a>
impl<'a> PartialOrd for NormalizedPath<'a>
impl<'a> Eq for NormalizedPath<'a>
impl<'a> StructuralPartialEq for NormalizedPath<'a>
Auto Trait Implementations§
impl<'a> Freeze for NormalizedPath<'a>
impl<'a> RefUnwindSafe for NormalizedPath<'a>
impl<'a> Send for NormalizedPath<'a>
impl<'a> Sync for NormalizedPath<'a>
impl<'a> Unpin for NormalizedPath<'a>
impl<'a> UnwindSafe for NormalizedPath<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.