pub struct PathSegments(/* private fields */);
Expand description
A series of PathSegment
s specifying the absolute path to something.
Implementations§
Source§impl PathSegments
impl PathSegments
Sourcepub const ROOT: PathSegments
pub const ROOT: PathSegments
The root path (i.e. /
).
Sourcepub fn push(&mut self, segment: PathSegment)
pub fn push(&mut self, segment: PathSegment)
Add a PathSegment
to this path.
Sourcepub fn pop(&mut self) -> Option<PathSegment>
pub fn pop(&mut self) -> Option<PathSegment>
Remove the last PathSegment
from this path, if one was present.
Sourcepub fn join(&self, segment: PathSegment) -> PathSegments
pub fn join(&self, segment: PathSegment) -> PathSegments
Get a new path by appending a PathSegment
to the current path.
Sourcepub fn iter(&self) -> impl Iterator<Item = &PathSegment> + '_
pub fn iter(&self) -> impl Iterator<Item = &PathSegment> + '_
Iterate over all the PathSegment
s in this path.
Trait Implementations§
Source§impl Clone for PathSegments
impl Clone for PathSegments
Source§fn clone(&self) -> PathSegments
fn clone(&self) -> PathSegments
Returns a copy 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 Debug for PathSegments
impl Debug for PathSegments
Source§impl Display for PathSegments
impl Display for PathSegments
Source§impl FromIterator<PathSegment> for PathSegments
impl FromIterator<PathSegment> for PathSegments
Source§fn from_iter<T: IntoIterator<Item = PathSegment>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = PathSegment>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl FromStr for PathSegments
impl FromStr for PathSegments
Source§impl Hash for PathSegments
impl Hash for PathSegments
Source§impl<'a> IntoIterator for &'a PathSegments
impl<'a> IntoIterator for &'a PathSegments
Source§impl IntoIterator for PathSegments
impl IntoIterator for PathSegments
Source§impl Ord for PathSegments
impl Ord for PathSegments
Source§fn cmp(&self, other: &PathSegments) -> Ordering
fn cmp(&self, other: &PathSegments) -> 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 PartialEq for PathSegments
impl PartialEq for PathSegments
Source§impl PartialOrd for PathSegments
impl PartialOrd for PathSegments
Source§impl ToPathSegments for PathSegments
impl ToPathSegments for PathSegments
Source§fn to_path_segments(&self) -> Result<PathSegments, PathSegmentError>
fn to_path_segments(&self) -> Result<PathSegments, PathSegmentError>
Convert to
PathSegments
.impl Eq for PathSegments
impl StructuralPartialEq for PathSegments
Auto Trait Implementations§
impl Freeze for PathSegments
impl RefUnwindSafe for PathSegments
impl Send for PathSegments
impl Sync for PathSegments
impl Unpin for PathSegments
impl UnwindSafe for PathSegments
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.