pub struct DestPath(/* private fields */);Expand description
Normalized relative path coordinate (always forward-slash).
Use resolve(root) to get a native filesystem path.
Implementations§
Source§impl DestPath
impl DestPath
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, DestPathError>
pub fn new(value: impl AsRef<str>) -> Result<Self, DestPathError>
Create from any string, normalizing separators and rejecting invalid paths.
Sourcepub fn resolve(&self, root: &Path) -> PathBuf
pub fn resolve(&self, root: &Path) -> PathBuf
Resolve to a native filesystem path under the given root.
Sourcepub fn components(&self) -> impl Iterator<Item = &str>
pub fn components(&self) -> impl Iterator<Item = &str>
Split into path components (by forward slash).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DestPath
impl<'de> Deserialize<'de> for DestPath
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DestPath
Source§impl Ord for DestPath
impl Ord for DestPath
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 DestPath
impl PartialOrd for DestPath
impl StructuralPartialEq for DestPath
Auto Trait Implementations§
impl Freeze for DestPath
impl RefUnwindSafe for DestPath
impl Send for DestPath
impl Sync for DestPath
impl Unpin for DestPath
impl UnsafeUnpin for DestPath
impl UnwindSafe for DestPath
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more