pub struct SourceSubpath(/* private fields */);Expand description
Normalized relative package coordinate under a fetched source root.
Implementations§
Source§impl SourceSubpath
impl SourceSubpath
pub fn new(value: impl AsRef<str>) -> Result<Self, SourceSubpathError>
pub fn as_str(&self) -> &str
pub fn as_path(&self) -> &Path
pub fn into_inner(self) -> String
Sourcepub fn join_under(&self, base: &Path) -> Result<PathBuf, SourceSubpathError>
pub fn join_under(&self, base: &Path) -> Result<PathBuf, SourceSubpathError>
Join this relative subpath under base, rejecting traversal attempts.
Trait Implementations§
Source§impl AsRef<str> for SourceSubpath
impl AsRef<str> for SourceSubpath
Source§impl Clone for SourceSubpath
impl Clone for SourceSubpath
Source§fn clone(&self) -> SourceSubpath
fn clone(&self) -> SourceSubpath
Returns a duplicate 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 SourceSubpath
impl Debug for SourceSubpath
Source§impl<'de> Deserialize<'de> for SourceSubpath
impl<'de> Deserialize<'de> for SourceSubpath
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
Source§impl Display for SourceSubpath
impl Display for SourceSubpath
Source§impl FromStr for SourceSubpath
impl FromStr for SourceSubpath
Source§impl Hash for SourceSubpath
impl Hash for SourceSubpath
Source§impl Ord for SourceSubpath
impl Ord for SourceSubpath
Source§fn cmp(&self, other: &SourceSubpath) -> Ordering
fn cmp(&self, other: &SourceSubpath) -> 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 SourceSubpath
impl PartialEq for SourceSubpath
Source§impl PartialOrd for SourceSubpath
impl PartialOrd for SourceSubpath
Source§impl Serialize for SourceSubpath
impl Serialize for SourceSubpath
impl Eq for SourceSubpath
impl StructuralPartialEq for SourceSubpath
Auto Trait Implementations§
impl Freeze for SourceSubpath
impl RefUnwindSafe for SourceSubpath
impl Send for SourceSubpath
impl Sync for SourceSubpath
impl Unpin for SourceSubpath
impl UnsafeUnpin for SourceSubpath
impl UnwindSafe for SourceSubpath
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.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