pub struct PathComponent(/* private fields */);Expand description
One path segment as stored, preserving display spelling.
Components are only produced by parsing an AbsolutePath or joining a
DisplayName, so there is no fallible string constructor.
Implementations§
Source§impl PathComponent
impl PathComponent
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the display spelling retained when the containing path was parsed.
Sourcepub fn to_display_name(&self) -> DisplayName
pub fn to_display_name(&self) -> DisplayName
Copies this parser-validated component into the equivalent DisplayName.
Trait Implementations§
Source§impl AsRef<str> for PathComponent
impl AsRef<str> for PathComponent
Source§impl Clone for PathComponent
impl Clone for PathComponent
Source§fn clone(&self) -> PathComponent
fn clone(&self) -> PathComponent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PathComponent
impl Debug for PathComponent
Source§impl Display for PathComponent
impl Display for PathComponent
impl Eq for PathComponent
Source§impl Hash for PathComponent
impl Hash for PathComponent
Source§impl Ord for PathComponent
impl Ord for PathComponent
Source§fn cmp(&self, other: &PathComponent) -> Ordering
fn cmp(&self, other: &PathComponent) -> Ordering
1.21.0 (const: unstable) · 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 PathComponent
impl PartialEq for PathComponent
Source§impl PartialOrd for PathComponent
impl PartialOrd for PathComponent
impl StructuralPartialEq for PathComponent
Auto Trait Implementations§
impl Freeze for PathComponent
impl RefUnwindSafe for PathComponent
impl Send for PathComponent
impl Sync for PathComponent
impl Unpin for PathComponent
impl UnsafeUnpin for PathComponent
impl UnwindSafe for PathComponent
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