Struct relative_path::RelativePath
source · [−]#[repr(transparent)]pub struct RelativePath { /* private fields */ }Expand description
A borrowed, immutable relative path.
Implementations
sourceimpl RelativePath
impl RelativePath
sourcepub fn new<S: AsRef<str> + ?Sized>(s: &S) -> &RelativePath
pub fn new<S: AsRef<str> + ?Sized>(s: &S) -> &RelativePath
Directly wraps a string slice as a RelativePath slice.
sourcepub fn from_path<P: ?Sized + AsRef<Path>>(
path: &P
) -> Result<&RelativePath, FromPathError>
pub fn from_path<P: ?Sized + AsRef<Path>>(
path: &P
) -> Result<&RelativePath, FromPathError>
Try to convert a Path to a RelativePath without allocating a buffer.
Errors
This requires the path to be a legal, platform-neutral relative path. Otherwise various forms of FromPathError will be returned as an Err.
Examples
use relative_path::{RelativePath, FromPathErrorKind};
assert_eq!(
Ok(RelativePath::new("foo/bar")),
RelativePath::from_path("foo/bar")
);
// Note: absolute paths are different depending on platform.
if cfg!(windows) {
let e = RelativePath::from_path("c:\\foo\\bar").unwrap_err();
assert_eq!(FromPathErrorKind::NonRelative, e.kind());
}
if cfg!(unix) {
let e = RelativePath::from_path("/foo/bar").unwrap_err();
assert_eq!(FromPathErrorKind::NonRelative, e.kind());
}sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Yields the underlying str slice.
Examples
use relative_path::RelativePath;
assert_eq!(RelativePath::new("foo.txt").as_str(), "foo.txt");sourcepub fn display(&self) -> Display<'_>
👎 Deprecated: RelativePath implements std::fmt::Display directly
pub fn display(&self) -> Display<'_>
RelativePath implements std::fmt::Display directly
sourcepub fn join<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
pub fn join<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
Creates an owned RelativePathBuf with path adjoined to self.
Examples
use relative_path::RelativePath;
let path = RelativePath::new("foo/bar");
assert_eq!("foo/bar/baz", path.join("baz"));sourcepub fn components(&self) -> Components<'_>ⓘNotable traits for Components<'a>impl<'a> Iterator for Components<'a> type Item = Component<'a>;
pub fn components(&self) -> Components<'_>ⓘNotable traits for Components<'a>impl<'a> Iterator for Components<'a> type Item = Component<'a>;
Iterate over all components in this relative path.
Examples
use relative_path::{Component, RelativePath};
let path = RelativePath::new("foo/bar/baz");
let mut it = path.components();
assert_eq!(Some(Component::Normal("foo")), it.next());
assert_eq!(Some(Component::Normal("bar")), it.next());
assert_eq!(Some(Component::Normal("baz")), it.next());
assert_eq!(None, it.next());sourcepub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>impl<'a> Iterator for Iter<'a> type Item = &'a str;
pub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>impl<'a> Iterator for Iter<'a> type Item = &'a str;
Produces an iterator over the path’s components viewed as str slices.
For more information about the particulars of how the path is separated into components, see components.
Examples
use relative_path::RelativePath;
let mut it = RelativePath::new("/tmp/foo.txt").iter();
assert_eq!(it.next(), Some("tmp"));
assert_eq!(it.next(), Some("foo.txt"));
assert_eq!(it.next(), None)sourcepub fn to_relative_path_buf(&self) -> RelativePathBuf
pub fn to_relative_path_buf(&self) -> RelativePathBuf
Convert to an owned RelativePathBuf.
sourcepub fn to_path<P: AsRef<Path>>(&self, base: P) -> PathBuf
pub fn to_path<P: AsRef<Path>>(&self, base: P) -> PathBuf
Build an owned PathBuf relative to base for the current relative
path.
Examples
use relative_path::RelativePath;
use std::path::Path;
let path = RelativePath::new("foo/bar").to_path(".");
assert_eq!(Path::new("./foo/bar"), path);
let path = RelativePath::new("foo/bar").to_path("");
assert_eq!(Path::new("foo/bar"), path);Encoding an absolute path
Absolute paths are, in contrast to when using PathBuf::push ignored and will be added unchanged to the buffer.
This is to preserve the probability of a path conversion failing if the relative path contains platform-specific absolute path components.
use relative_path::RelativePath;
use std::path::Path;
if cfg!(windows) {
let path = RelativePath::new("/bar/baz").to_path("foo");
assert_eq!(Path::new("foo\\bar\\baz"), path);
let path = RelativePath::new("c:\\bar\\baz").to_path("foo");
assert_eq!(Path::new("foo\\c:\\bar\\baz"), path);
}
if cfg!(unix) {
let path = RelativePath::new("/bar/baz").to_path("foo");
assert_eq!(Path::new("foo/bar/baz"), path);
let path = RelativePath::new("c:\\bar\\baz").to_path("foo");
assert_eq!(Path::new("foo/c:\\bar\\baz"), path);
}sourcepub fn to_logical_path<P: AsRef<Path>>(&self, base: P) -> PathBuf
pub fn to_logical_path<P: AsRef<Path>>(&self, base: P) -> PathBuf
Build an owned PathBuf relative to base for the current relative
path.
This is similar to to_path except that it doesn’t just unconditionally append one path to the other, instead it performs the following operations depending on its own components:
- Component::CurDir leaves the
baseunmodified. - Component::ParentDir removes a component from
baseusing path::PathBuf::pop. - Component::Normal pushes the given path component onto
baseusing the same mechanism as to_path.
Note that the exact semantics of the path operation is determined by the
corresponding PathBuf operation. E.g. popping a component off a path
like . will result in an empty path.
use relative_path::RelativePath;
use std::path::Path;
let path = RelativePath::new("..").to_logical_path(".");
assert_eq!(path, Path::new(""));Examples
use relative_path::RelativePath;
use std::path::Path;
let path = RelativePath::new("..").to_logical_path("foo/bar");
assert_eq!(path, Path::new("foo"));Encoding an absolute path
Behaves the same as to_path when encoding absolute paths.
Absolute paths are, in contrast to when using PathBuf::push ignored and will be added unchanged to the buffer.
This is to preserve the probability of a path conversion failing if the relative path contains platform-specific absolute path components.
use relative_path::RelativePath;
use std::path::Path;
if cfg!(windows) {
let path = RelativePath::new("/bar/baz").to_logical_path("foo");
assert_eq!(Path::new("foo\\bar\\baz"), path);
let path = RelativePath::new("c:\\bar\\baz").to_logical_path("foo");
assert_eq!(Path::new("foo\\c:\\bar\\baz"), path);
let path = RelativePath::new("foo/bar").to_logical_path("");
assert_eq!(Path::new("foo\\bar"), path);
}
if cfg!(unix) {
let path = RelativePath::new("/bar/baz").to_logical_path("foo");
assert_eq!(Path::new("foo/bar/baz"), path);
let path = RelativePath::new("c:\\bar\\baz").to_logical_path("foo");
assert_eq!(Path::new("foo/c:\\bar\\baz"), path);
let path = RelativePath::new("foo/bar").to_logical_path("");
assert_eq!(Path::new("foo/bar"), path);
}sourcepub fn parent(&self) -> Option<&RelativePath>
pub fn parent(&self) -> Option<&RelativePath>
Returns a relative path, without its final Component if there is one.
Examples
use relative_path::RelativePath;
assert_eq!(Some(RelativePath::new("foo")), RelativePath::new("foo/bar").parent());
assert_eq!(Some(RelativePath::new("")), RelativePath::new("foo").parent());
assert_eq!(None, RelativePath::new("").parent());sourcepub fn file_name(&self) -> Option<&str>
pub fn file_name(&self) -> Option<&str>
Returns the final component of the RelativePath, if there is one.
If the path is a normal file, this is the file name. If it’s the path of a directory, this is the directory name.
Returns None If the path terminates in ...
Examples
use relative_path::RelativePath;
assert_eq!(Some("bin"), RelativePath::new("usr/bin/").file_name());
assert_eq!(Some("foo.txt"), RelativePath::new("tmp/foo.txt").file_name());
assert_eq!(Some("foo.txt"), RelativePath::new("tmp/foo.txt/").file_name());
assert_eq!(Some("foo.txt"), RelativePath::new("foo.txt/.").file_name());
assert_eq!(Some("foo.txt"), RelativePath::new("foo.txt/.//").file_name());
assert_eq!(None, RelativePath::new("foo.txt/..").file_name());
assert_eq!(None, RelativePath::new("/").file_name());sourcepub fn strip_prefix<P: AsRef<RelativePath>>(
&self,
base: P
) -> Result<&RelativePath, StripPrefixError>
pub fn strip_prefix<P: AsRef<RelativePath>>(
&self,
base: P
) -> Result<&RelativePath, StripPrefixError>
Returns a relative path that, when joined onto base, yields self.
Errors
If base is not a prefix of self (i.e. starts_with
returns false), returns Err.
Examples
use relative_path::RelativePath;
let path = RelativePath::new("test/haha/foo.txt");
assert_eq!(path.strip_prefix("test"), Ok(RelativePath::new("haha/foo.txt")));
assert_eq!(path.strip_prefix("test").is_ok(), true);
assert_eq!(path.strip_prefix("haha").is_ok(), false);sourcepub fn starts_with<P: AsRef<RelativePath>>(&self, base: P) -> bool
pub fn starts_with<P: AsRef<RelativePath>>(&self, base: P) -> bool
Determines whether base is a prefix of self.
Only considers whole path components to match.
Examples
use relative_path::RelativePath;
let path = RelativePath::new("etc/passwd");
assert!(path.starts_with("etc"));
assert!(!path.starts_with("e"));sourcepub fn ends_with<P: AsRef<RelativePath>>(&self, child: P) -> bool
pub fn ends_with<P: AsRef<RelativePath>>(&self, child: P) -> bool
Determines whether child is a suffix of self.
Only considers whole path components to match.
Examples
use relative_path::RelativePath;
let path = RelativePath::new("etc/passwd");
assert!(path.ends_with("passwd"));sourcepub fn is_normalized(&self) -> bool
pub fn is_normalized(&self) -> bool
Determines whether self is normalized.
Examples
use relative_path::RelativePath;
// These are normalized.
assert!(RelativePath::new("").is_normalized());
assert!(RelativePath::new("baz.txt").is_normalized());
assert!(RelativePath::new("foo/bar/baz.txt").is_normalized());
assert!(RelativePath::new("..").is_normalized());
assert!(RelativePath::new("../..").is_normalized());
assert!(RelativePath::new("../../foo/bar/baz.txt").is_normalized());
// These are not normalized.
assert!(!RelativePath::new(".").is_normalized());
assert!(!RelativePath::new("./baz.txt").is_normalized());
assert!(!RelativePath::new("foo/..").is_normalized());
assert!(!RelativePath::new("foo/../baz.txt").is_normalized());
assert!(!RelativePath::new("foo/.").is_normalized());
assert!(!RelativePath::new("foo/./baz.txt").is_normalized());
assert!(!RelativePath::new("../foo/./bar/../baz.txt").is_normalized());sourcepub fn with_file_name<S: AsRef<str>>(&self, file_name: S) -> RelativePathBuf
pub fn with_file_name<S: AsRef<str>>(&self, file_name: S) -> RelativePathBuf
Creates an owned RelativePathBuf like self but with the given file name.
See set_file_name for more details.
Examples
use relative_path::{RelativePath, RelativePathBuf};
let path = RelativePath::new("tmp/foo.txt");
assert_eq!(path.with_file_name("bar.txt"), RelativePathBuf::from("tmp/bar.txt"));
let path = RelativePath::new("tmp");
assert_eq!(path.with_file_name("var"), RelativePathBuf::from("var"));sourcepub fn file_stem(&self) -> Option<&str>
pub fn file_stem(&self) -> Option<&str>
Extracts the stem (non-extension) portion of file_name.
The stem is:
- None, if there is no file name;
- The entire file name if there is no embedded
.; - The entire file name if the file name begins with
.and has no other.s within; - Otherwise, the portion of the file name before the final
.
Examples
use relative_path::RelativePath;
let path = RelativePath::new("foo.rs");
assert_eq!("foo", path.file_stem().unwrap());sourcepub fn extension(&self) -> Option<&str>
pub fn extension(&self) -> Option<&str>
Extracts the extension of file_name, if possible.
The extension is:
- None, if there is no file name;
- None, if there is no embedded
.; - None, if the file name begins with
.and has no other.s within; - Otherwise, the portion of the file name after the final
.
Examples
use relative_path::RelativePath;
assert_eq!(Some("rs"), RelativePath::new("foo.rs").extension());
assert_eq!(None, RelativePath::new(".rs").extension());
assert_eq!(Some("rs"), RelativePath::new("foo.rs/.").extension());sourcepub fn with_extension<S: AsRef<str>>(&self, extension: S) -> RelativePathBuf
pub fn with_extension<S: AsRef<str>>(&self, extension: S) -> RelativePathBuf
Creates an owned RelativePathBuf like self but with the given extension.
See set_extension for more details.
Examples
use relative_path::{RelativePath, RelativePathBuf};
let path = RelativePath::new("foo.rs");
assert_eq!(path.with_extension("txt"), RelativePathBuf::from("foo.txt"));sourcepub fn join_normalized<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
pub fn join_normalized<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
Build an owned RelativePathBuf, joined with the given path and normalized.
Examples
use relative_path::RelativePath;
assert_eq!(
RelativePath::new("foo/baz.txt"),
RelativePath::new("foo/bar").join_normalized("../baz.txt").as_relative_path()
);
assert_eq!(
RelativePath::new("../foo/baz.txt"),
RelativePath::new("../foo/bar").join_normalized("../baz.txt").as_relative_path()
);sourcepub fn normalize(&self) -> RelativePathBuf
pub fn normalize(&self) -> RelativePathBuf
Return an owned RelativePathBuf, with all non-normal components moved to the beginning of the path.
This permits for a normalized representation of different relative components.
Normalization is a destructive operation if the path references an actual filesystem
path.
An example of this is symlinks under unix, a path like foo/../bar might reference a
different location other than ./bar.
Normalization is a logical operation that is only valid if the relative path is part of some context which doesn’t have semantics that causes it to break, like symbolic links.
Examples
use relative_path::RelativePath;
assert_eq!(
"../foo/baz.txt",
RelativePath::new("../foo/./bar/../baz.txt").normalize()
);
assert_eq!(
"",
RelativePath::new(".").normalize()
);sourcepub fn relative<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
pub fn relative<P: AsRef<RelativePath>>(&self, path: P) -> RelativePathBuf
Constructs a relative path from the current path, to path.
This function will return the empty RelativePath "" if this source
contains unnamed components like .. that would have to be traversed to
reach the destination path. This is necessary since we have no way of
knowing what the names of those components are when we’re building the
new relative path.
use relative_path::RelativePath;
// Here we don't know what directories `../..` refers to, so there's no
// way to construct a path back to `bar` in the current directory from
// `../..`.
let from = RelativePath::new("../../foo/relative-path");
let to = RelativePath::new("bar");
assert_eq!("", from.relative(to));One exception to this is when two paths contains a common prefix at which point there’s no need to know what the names of those unnamed components are.
use relative_path::RelativePath;
let from = RelativePath::new("../../foo/bar");
let to = RelativePath::new("../../foo/baz");
assert_eq!("../baz", from.relative(to));
let from = RelativePath::new("../a/../../foo/bar");
let to = RelativePath::new("../../foo/baz");
assert_eq!("../baz", from.relative(to));Examples
use relative_path::RelativePath;
assert_eq!(
"../../e/f",
RelativePath::new("a/b/c/d").relative(RelativePath::new("a/b/e/f"))
);
assert_eq!(
"../bbb",
RelativePath::new("a/../aaa").relative(RelativePath::new("b/../bbb"))
);
let a = RelativePath::new("git/relative-path");
let b = RelativePath::new("git");
assert_eq!("relative-path", b.relative(a));
assert_eq!("..", a.relative(b));
let a = RelativePath::new("foo/bar/bap/foo.h");
let b = RelativePath::new("../arch/foo.h");
assert_eq!("../../../../../arch/foo.h", a.relative(b));
assert_eq!("", b.relative(a));Trait Implementations
sourceimpl AsRef<RelativePath> for RelativePath
impl AsRef<RelativePath> for RelativePath
sourcefn as_ref(&self) -> &RelativePath
fn as_ref(&self) -> &RelativePath
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<RelativePath> for RelativePathBuf
impl AsRef<RelativePath> for RelativePathBuf
sourcefn as_ref(&self) -> &RelativePath
fn as_ref(&self) -> &RelativePath
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<RelativePath> for String
impl AsRef<RelativePath> for String
sourcefn as_ref(&self) -> &RelativePath
fn as_ref(&self) -> &RelativePath
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<RelativePath> for str
impl AsRef<RelativePath> for str
sourcefn as_ref(&self) -> &RelativePath
fn as_ref(&self) -> &RelativePath
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Borrow<RelativePath> for RelativePathBuf
impl Borrow<RelativePath> for RelativePathBuf
sourcefn borrow(&self) -> &RelativePath
fn borrow(&self) -> &RelativePath
Immutably borrows from an owned value. Read more
sourceimpl Clone for Box<RelativePath>
impl Clone for Box<RelativePath>
sourceimpl Debug for RelativePath
impl Debug for RelativePath
sourceimpl Display for RelativePath
impl Display for RelativePath
sourceimpl<'a> From<&'a RelativePath> for Cow<'a, RelativePath>
impl<'a> From<&'a RelativePath> for Cow<'a, RelativePath>
sourcefn from(s: &'a RelativePath) -> Cow<'a, RelativePath>
fn from(s: &'a RelativePath) -> Cow<'a, RelativePath>
Converts to this type from the input type.
sourceimpl From<&RelativePath> for Arc<RelativePath>
impl From<&RelativePath> for Arc<RelativePath>
sourcefn from(path: &RelativePath) -> Arc<RelativePath>
fn from(path: &RelativePath) -> Arc<RelativePath>
Converts to this type from the input type.
sourceimpl From<&RelativePath> for Box<RelativePath>
impl From<&RelativePath> for Box<RelativePath>
sourcefn from(path: &RelativePath) -> Box<RelativePath>
fn from(path: &RelativePath) -> Box<RelativePath>
Converts to this type from the input type.
sourceimpl From<&RelativePath> for Rc<RelativePath>
impl From<&RelativePath> for Rc<RelativePath>
sourcefn from(path: &RelativePath) -> Rc<RelativePath>
fn from(path: &RelativePath) -> Rc<RelativePath>
Converts to this type from the input type.
sourceimpl From<RelativePathBuf> for Box<RelativePath>
impl From<RelativePathBuf> for Box<RelativePath>
sourcefn from(path: RelativePathBuf) -> Box<RelativePath>
fn from(path: RelativePathBuf) -> Box<RelativePath>
Converts to this type from the input type.
sourceimpl Hash for RelativePath
impl Hash for RelativePath
sourceimpl Ord for RelativePath
impl Ord for RelativePath
sourceimpl<'a, 'b> PartialEq<&'a RelativePath> for RelativePathBuf
impl<'a, 'b> PartialEq<&'a RelativePath> for RelativePathBuf
sourceimpl<'a, 'b> PartialEq<&'a RelativePath> for String
impl<'a, 'b> PartialEq<&'a RelativePath> for String
sourceimpl<'a, 'b> PartialEq<&'a RelativePath> for str
impl<'a, 'b> PartialEq<&'a RelativePath> for str
sourceimpl<'a, 'b> PartialEq<&'a str> for RelativePath
impl<'a, 'b> PartialEq<&'a str> for RelativePath
sourceimpl<'a, 'b> PartialEq<&'b RelativePath> for Cow<'a, RelativePath>
impl<'a, 'b> PartialEq<&'b RelativePath> for Cow<'a, RelativePath>
sourceimpl<'a, 'b> PartialEq<Cow<'a, RelativePath>> for &'b RelativePath
impl<'a, 'b> PartialEq<Cow<'a, RelativePath>> for &'b RelativePath
sourceimpl<'a, 'b> PartialEq<Cow<'a, RelativePath>> for RelativePath
impl<'a, 'b> PartialEq<Cow<'a, RelativePath>> for RelativePath
sourceimpl<'a, 'b> PartialEq<RelativePath> for &'a str
impl<'a, 'b> PartialEq<RelativePath> for &'a str
sourceimpl<'a, 'b> PartialEq<RelativePath> for Cow<'a, RelativePath>
impl<'a, 'b> PartialEq<RelativePath> for Cow<'a, RelativePath>
sourceimpl PartialEq<RelativePath> for RelativePath
impl PartialEq<RelativePath> for RelativePath
sourceimpl<'a, 'b> PartialEq<RelativePath> for RelativePathBuf
impl<'a, 'b> PartialEq<RelativePath> for RelativePathBuf
sourceimpl<'a, 'b> PartialEq<RelativePath> for String
impl<'a, 'b> PartialEq<RelativePath> for String
sourceimpl<'a, 'b> PartialEq<RelativePath> for str
impl<'a, 'b> PartialEq<RelativePath> for str
sourceimpl<'a, 'b> PartialEq<RelativePathBuf> for &'a RelativePath
impl<'a, 'b> PartialEq<RelativePathBuf> for &'a RelativePath
sourceimpl<'a, 'b> PartialEq<RelativePathBuf> for RelativePath
impl<'a, 'b> PartialEq<RelativePathBuf> for RelativePath
sourceimpl<'a, 'b> PartialEq<String> for &'a RelativePath
impl<'a, 'b> PartialEq<String> for &'a RelativePath
sourceimpl<'a, 'b> PartialEq<String> for RelativePath
impl<'a, 'b> PartialEq<String> for RelativePath
sourceimpl<'a, 'b> PartialEq<str> for &'a RelativePath
impl<'a, 'b> PartialEq<str> for &'a RelativePath
sourceimpl<'a, 'b> PartialEq<str> for RelativePath
impl<'a, 'b> PartialEq<str> for RelativePath
sourceimpl<'a, 'b> PartialOrd<&'a RelativePath> for RelativePathBuf
impl<'a, 'b> PartialOrd<&'a RelativePath> for RelativePathBuf
sourcefn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<&'a RelativePath> for String
impl<'a, 'b> PartialOrd<&'a RelativePath> for String
sourcefn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<&'a RelativePath> for str
impl<'a, 'b> PartialOrd<&'a RelativePath> for str
sourcefn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &&'a RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<&'a str> for RelativePath
impl<'a, 'b> PartialOrd<&'a str> for RelativePath
sourcefn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<&'b RelativePath> for Cow<'a, RelativePath>
impl<'a, 'b> PartialOrd<&'b RelativePath> for Cow<'a, RelativePath>
sourcefn partial_cmp(&self, other: &&'b RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &&'b RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<Cow<'a, RelativePath>> for &'b RelativePath
impl<'a, 'b> PartialOrd<Cow<'a, RelativePath>> for &'b RelativePath
sourcefn partial_cmp(&self, other: &Cow<'a, RelativePath>) -> Option<Ordering>
fn partial_cmp(&self, other: &Cow<'a, RelativePath>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<Cow<'a, RelativePath>> for RelativePath
impl<'a, 'b> PartialOrd<Cow<'a, RelativePath>> for RelativePath
sourcefn partial_cmp(&self, other: &Cow<'a, RelativePath>) -> Option<Ordering>
fn partial_cmp(&self, other: &Cow<'a, RelativePath>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePath> for &'a str
impl<'a, 'b> PartialOrd<RelativePath> for &'a str
sourcefn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePath> for Cow<'a, RelativePath>
impl<'a, 'b> PartialOrd<RelativePath> for Cow<'a, RelativePath>
sourcefn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl PartialOrd<RelativePath> for RelativePath
impl PartialOrd<RelativePath> for RelativePath
sourcefn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePath> for RelativePathBuf
impl<'a, 'b> PartialOrd<RelativePath> for RelativePathBuf
sourcefn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePath> for String
impl<'a, 'b> PartialOrd<RelativePath> for String
sourcefn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePath> for str
impl<'a, 'b> PartialOrd<RelativePath> for str
sourcefn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePath) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePathBuf> for &'a RelativePath
impl<'a, 'b> PartialOrd<RelativePathBuf> for &'a RelativePath
sourcefn partial_cmp(&self, other: &RelativePathBuf) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePathBuf) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<RelativePathBuf> for RelativePath
impl<'a, 'b> PartialOrd<RelativePathBuf> for RelativePath
sourcefn partial_cmp(&self, other: &RelativePathBuf) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativePathBuf) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<String> for &'a RelativePath
impl<'a, 'b> PartialOrd<String> for &'a RelativePath
sourcefn partial_cmp(&self, other: &String) -> Option<Ordering>
fn partial_cmp(&self, other: &String) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<String> for RelativePath
impl<'a, 'b> PartialOrd<String> for RelativePath
sourcefn partial_cmp(&self, other: &String) -> Option<Ordering>
fn partial_cmp(&self, other: &String) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<str> for &'a RelativePath
impl<'a, 'b> PartialOrd<str> for &'a RelativePath
sourcefn partial_cmp(&self, other: &str) -> Option<Ordering>
fn partial_cmp(&self, other: &str) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a, 'b> PartialOrd<str> for RelativePath
impl<'a, 'b> PartialOrd<str> for RelativePath
sourcefn partial_cmp(&self, other: &str) -> Option<Ordering>
fn partial_cmp(&self, other: &str) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl Serialize for RelativePath
impl Serialize for RelativePath
sourceimpl ToOwned for RelativePath
impl ToOwned for RelativePath
type Owned = RelativePathBuf
type Owned = RelativePathBuf
The resulting type after obtaining ownership.
sourcefn to_owned(&self) -> RelativePathBuf
fn to_owned(&self) -> RelativePathBuf
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more