pub struct M2dirPath(/* private fields */);Expand description
Forward-slash separated path.
Always uses / regardless of host OS. std::fs::* accepts /-paths
on both Unix and Windows, so no boundary conversion is needed in the
client layer.
Implementations§
Source§impl M2dirPath
impl M2dirPath
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the underlying String.
Sourcepub fn join(&self, segment: &str) -> Self
pub fn join(&self, segment: &str) -> Self
Returns a new path with segment appended after a /
separator.
If self is empty the result is segment alone (no leading
/). Trailing / in self is normalized.
Sourcepub fn push(&mut self, segment: &str)
pub fn push(&mut self, segment: &str)
Appends segment to this path in place, inserting a /
separator unless self is empty or already ends with one.
Sourcepub fn strip_prefix(&self, prefix: &Self) -> Option<&str>
pub fn strip_prefix(&self, prefix: &Self) -> Option<&str>
If self is rooted at prefix, returns the relative remainder
(without leading /).
Sourcepub fn starts_with(&self, prefix: &Self) -> bool
pub fn starts_with(&self, prefix: &Self) -> bool
Returns true when this path begins with prefix.
Sourcepub fn components(&self) -> impl Iterator<Item = &str>
pub fn components(&self) -> impl Iterator<Item = &str>
Iterates over the non-empty components of this path.
Trait Implementations§
Source§impl AsRef<M2dirPath> for M2dirStore
impl AsRef<M2dirPath> for M2dirStore
impl Eq for M2dirPath
Source§impl From<M2dirPath> for M2dirStore
impl From<M2dirPath> for M2dirStore
Source§impl Ord for M2dirPath
impl Ord for M2dirPath
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 PartialOrd for M2dirPath
impl PartialOrd for M2dirPath
impl StructuralPartialEq for M2dirPath
Auto Trait Implementations§
impl Freeze for M2dirPath
impl RefUnwindSafe for M2dirPath
impl Send for M2dirPath
impl Sync for M2dirPath
impl Unpin for M2dirPath
impl UnsafeUnpin for M2dirPath
impl UnwindSafe for M2dirPath
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