pub struct VdirPath(/* 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 VdirPath
impl VdirPath
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 with_file_name(&self, name: &str) -> Self
pub fn with_file_name(&self, name: &str) -> Self
Replaces the final component of this path with name.
If self has no parent, the result is name alone.
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<VdirPath> for VdirCollection
impl AsRef<VdirPath> for VdirCollection
Source§impl<'de> Deserialize<'de> for VdirPath
impl<'de> Deserialize<'de> for VdirPath
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for VdirPath
Source§impl From<VdirPath> for VdirCollection
impl From<VdirPath> for VdirCollection
Source§impl Ord for VdirPath
impl Ord for VdirPath
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 VdirPath
impl PartialOrd for VdirPath
impl StructuralPartialEq for VdirPath
Auto Trait Implementations§
impl Freeze for VdirPath
impl RefUnwindSafe for VdirPath
impl Send for VdirPath
impl Sync for VdirPath
impl Unpin for VdirPath
impl UnsafeUnpin for VdirPath
impl UnwindSafe for VdirPath
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