Struct seacan::Utf8Path [−][src]
#[repr(transparent)]pub struct Utf8Path(_);
Expand description
A slice of a UTF-8 path (akin to str
).
This type supports a number of operations for inspecting a path, including
breaking the path into its components (separated by /
on Unix and by either
/
or \
on Windows), extracting the file name, determining whether the path
is absolute, and so on.
This is an unsized type, meaning that it must always be used behind a
pointer like &
or Box
. For an owned version of this type,
see Utf8PathBuf
.
Examples
use camino::Utf8Path; // Note: this example does work on Windows let path = Utf8Path::new("./foo/bar.txt"); let parent = path.parent(); assert_eq!(parent, Some(Utf8Path::new("./foo"))); let file_stem = path.file_stem(); assert_eq!(file_stem, Some("bar")); let extension = path.extension(); assert_eq!(extension, Some("txt"));
Implementations
impl Utf8Path
[src]
impl Utf8Path
[src]pub fn new(s: &impl AsRef<str>) -> &Utf8Path
[src]
pub fn new(s: &impl AsRef<str>) -> &Utf8Path
[src]Directly wraps a string slice as a Utf8Path
slice.
This is a cost-free conversion.
Examples
use camino::Utf8Path; Utf8Path::new("foo.txt");
You can create Utf8Path
s from String
s, or even other Utf8Path
s:
use camino::Utf8Path; let string = String::from("foo.txt"); let from_string = Utf8Path::new(&string); let from_path = Utf8Path::new(&from_string); assert_eq!(from_string, from_path);
pub fn from_path(path: &Path) -> Option<&Utf8Path>
[src]
pub fn from_path(path: &Path) -> Option<&Utf8Path>
[src]Converts a Path
to a Utf8Path
.
Returns None
if the path is not valid UTF-8.
Examples
use camino::Utf8Path; use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; use std::path::Path; let unicode_path = Path::new("/valid/unicode"); Utf8Path::from_path(unicode_path).expect("valid Unicode path succeeded"); // Paths on Unix can be non-UTF-8. let non_unicode_str = OsStr::from_bytes(b"\xFF\xFF\xFF"); let non_unicode_path = Path::new(non_unicode_str); assert!(Utf8Path::from_path(non_unicode_path).is_none(), "non-Unicode path failed");
pub fn as_str(&self) -> &str
[src]
pub fn as_str(&self) -> &str
[src]Yields the underlying str
slice.
Unlike Path::to_str
, this always returns a slice because the contents of a Utf8Path
are guaranteed to be valid UTF-8.
Examples
use camino::Utf8Path; let s = Utf8Path::new("foo.txt").as_str(); assert_eq!(s, "foo.txt");
pub fn to_path_buf(&self) -> Utf8PathBuf
[src]
pub fn to_path_buf(&self) -> Utf8PathBuf
[src]Converts a Utf8Path
to an owned Utf8PathBuf
.
Examples
use camino::{Utf8Path, Utf8PathBuf}; let path_buf = Utf8Path::new("foo.txt").to_path_buf(); assert_eq!(path_buf, Utf8PathBuf::from("foo.txt"));
pub fn is_absolute(&self) -> bool
[src]
pub fn is_absolute(&self) -> bool
[src]Returns true
if the Utf8Path
is absolute, i.e., if it is independent of
the current directory.
-
On Unix, a path is absolute if it starts with the root, so
is_absolute
andhas_root
are equivalent. -
On Windows, a path is absolute if it has a prefix and starts with the root:
c:\windows
is absolute, whilec:temp
and\temp
are not.
Examples
use camino::Utf8Path; assert!(!Utf8Path::new("foo.txt").is_absolute());
pub fn is_relative(&self) -> bool
[src]
pub fn is_relative(&self) -> bool
[src]Returns true
if the Utf8Path
is relative, i.e., not absolute.
See is_absolute
’s documentation for more details.
Examples
use camino::Utf8Path; assert!(Utf8Path::new("foo.txt").is_relative());
pub fn has_root(&self) -> bool
[src]
pub fn has_root(&self) -> bool
[src]Returns true
if the Utf8Path
has a root.
-
On Unix, a path has a root if it begins with
/
. -
On Windows, a path has a root if it:
- has no prefix and begins with a separator, e.g.,
\windows
- has a prefix followed by a separator, e.g.,
c:\windows
but notc:windows
- has any non-disk prefix, e.g.,
\\server\share
- has no prefix and begins with a separator, e.g.,
Examples
use camino::Utf8Path; assert!(Utf8Path::new("/etc/passwd").has_root());
pub fn parent(&self) -> Option<&Utf8Path>
[src]
pub fn parent(&self) -> Option<&Utf8Path>
[src]Returns the Path
without its final component, if there is one.
Returns None
if the path terminates in a root or prefix.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/foo/bar"); let parent = path.parent().unwrap(); assert_eq!(parent, Utf8Path::new("/foo")); let grand_parent = parent.parent().unwrap(); assert_eq!(grand_parent, Utf8Path::new("/")); assert_eq!(grand_parent.parent(), None);
pub fn ancestors(&self) -> Utf8Ancestors<'_>
[src]
pub fn ancestors(&self) -> Utf8Ancestors<'_>
[src]Produces an iterator over Utf8Path
and its ancestors.
The iterator will yield the Utf8Path
that is returned if the parent
method is used zero
or more times. That means, the iterator will yield &self
, &self.parent().unwrap()
,
&self.parent().unwrap().parent().unwrap()
and so on. If the parent
method returns
None
, the iterator will do likewise. The iterator will always yield at least one value,
namely &self
.
Examples
use camino::Utf8Path; let mut ancestors = Utf8Path::new("/foo/bar").ancestors(); assert_eq!(ancestors.next(), Some(Utf8Path::new("/foo/bar"))); assert_eq!(ancestors.next(), Some(Utf8Path::new("/foo"))); assert_eq!(ancestors.next(), Some(Utf8Path::new("/"))); assert_eq!(ancestors.next(), None); let mut ancestors = Utf8Path::new("../foo/bar").ancestors(); assert_eq!(ancestors.next(), Some(Utf8Path::new("../foo/bar"))); assert_eq!(ancestors.next(), Some(Utf8Path::new("../foo"))); assert_eq!(ancestors.next(), Some(Utf8Path::new(".."))); assert_eq!(ancestors.next(), Some(Utf8Path::new(""))); assert_eq!(ancestors.next(), None);
pub fn file_name(&self) -> Option<&str>
[src]
pub fn file_name(&self) -> Option<&str>
[src]Returns the final component of the Utf8Path
, 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 camino::Utf8Path; assert_eq!(Some("bin"), Utf8Path::new("/usr/bin/").file_name()); assert_eq!(Some("foo.txt"), Utf8Path::new("tmp/foo.txt").file_name()); assert_eq!(Some("foo.txt"), Utf8Path::new("foo.txt/.").file_name()); assert_eq!(Some("foo.txt"), Utf8Path::new("foo.txt/.//").file_name()); assert_eq!(None, Utf8Path::new("foo.txt/..").file_name()); assert_eq!(None, Utf8Path::new("/").file_name());
pub fn strip_prefix(
&self,
base: impl AsRef<Path>
) -> Result<&Utf8Path, StripPrefixError>
[src]
pub fn strip_prefix(
&self,
base: impl AsRef<Path>
) -> Result<&Utf8Path, StripPrefixError>
[src]Returns a 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 camino::{Utf8Path, Utf8PathBuf}; let path = Utf8Path::new("/test/haha/foo.txt"); assert_eq!(path.strip_prefix("/"), Ok(Utf8Path::new("test/haha/foo.txt"))); assert_eq!(path.strip_prefix("/test"), Ok(Utf8Path::new("haha/foo.txt"))); assert_eq!(path.strip_prefix("/test/"), Ok(Utf8Path::new("haha/foo.txt"))); assert_eq!(path.strip_prefix("/test/haha/foo.txt"), Ok(Utf8Path::new(""))); assert_eq!(path.strip_prefix("/test/haha/foo.txt/"), Ok(Utf8Path::new(""))); assert!(path.strip_prefix("test").is_err()); assert!(path.strip_prefix("/haha").is_err()); let prefix = Utf8PathBuf::from("/test/"); assert_eq!(path.strip_prefix(prefix), Ok(Utf8Path::new("haha/foo.txt")));
pub fn starts_with(&self, base: impl AsRef<Path>) -> bool
[src]
pub fn starts_with(&self, base: impl AsRef<Path>) -> bool
[src]Determines whether base
is a prefix of self
.
Only considers whole path components to match.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/etc/passwd"); assert!(path.starts_with("/etc")); assert!(path.starts_with("/etc/")); assert!(path.starts_with("/etc/passwd")); assert!(path.starts_with("/etc/passwd/")); // extra slash is okay assert!(path.starts_with("/etc/passwd///")); // multiple extra slashes are okay assert!(!path.starts_with("/e")); assert!(!path.starts_with("/etc/passwd.txt")); assert!(!Utf8Path::new("/etc/foo.rs").starts_with("/etc/foo"));
pub fn ends_with(&self, base: impl AsRef<Path>) -> bool
[src]
pub fn ends_with(&self, base: impl AsRef<Path>) -> bool
[src]Determines whether child
is a suffix of self
.
Only considers whole path components to match.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/etc/resolv.conf"); assert!(path.ends_with("resolv.conf")); assert!(path.ends_with("etc/resolv.conf")); assert!(path.ends_with("/etc/resolv.conf")); assert!(!path.ends_with("/resolv.conf")); assert!(!path.ends_with("conf")); // use .extension() instead
pub fn file_stem(&self) -> Option<&str>
[src]
pub fn file_stem(&self) -> Option<&str>
[src]Extracts the stem (non-extension) portion of self.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 camino::Utf8Path; assert_eq!("foo", Utf8Path::new("foo.rs").file_stem().unwrap()); assert_eq!("foo.tar", Utf8Path::new("foo.tar.gz").file_stem().unwrap());
pub fn extension(&self) -> Option<&str>
[src]
pub fn extension(&self) -> Option<&str>
[src]Extracts the extension of self.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 camino::Utf8Path; assert_eq!("rs", Utf8Path::new("foo.rs").extension().unwrap()); assert_eq!("gz", Utf8Path::new("foo.tar.gz").extension().unwrap());
pub fn join(&self, path: impl AsRef<Utf8Path>) -> Utf8PathBuf
[src]
pub fn join(&self, path: impl AsRef<Utf8Path>) -> Utf8PathBuf
[src]Creates an owned Utf8PathBuf
with path
adjoined to self
.
See Utf8PathBuf::push
for more details on what it means to adjoin a path.
Examples
use camino::{Utf8Path, Utf8PathBuf}; assert_eq!(Utf8Path::new("/etc").join("passwd"), Utf8PathBuf::from("/etc/passwd"));
pub fn join_os(&self, path: impl AsRef<Path>) -> PathBuf
[src]
pub fn join_os(&self, path: impl AsRef<Path>) -> PathBuf
[src]Creates an owned PathBuf
with path
adjoined to self
.
See PathBuf::push
for more details on what it means to adjoin a path.
Examples
use camino::Utf8Path; use std::path::PathBuf; assert_eq!(Utf8Path::new("/etc").join_os("passwd"), PathBuf::from("/etc/passwd"));
pub fn with_file_name(&self, file_name: impl AsRef<str>) -> Utf8PathBuf
[src]
pub fn with_file_name(&self, file_name: impl AsRef<str>) -> Utf8PathBuf
[src]Creates an owned Utf8PathBuf
like self
but with the given file name.
See Utf8PathBuf::set_file_name
for more details.
Examples
use camino::{Utf8Path, Utf8PathBuf}; let path = Utf8Path::new("/tmp/foo.txt"); assert_eq!(path.with_file_name("bar.txt"), Utf8PathBuf::from("/tmp/bar.txt")); let path = Utf8Path::new("/tmp"); assert_eq!(path.with_file_name("var"), Utf8PathBuf::from("/var"));
pub fn with_extension(&self, extension: impl AsRef<str>) -> Utf8PathBuf
[src]
pub fn with_extension(&self, extension: impl AsRef<str>) -> Utf8PathBuf
[src]Creates an owned Utf8PathBuf
like self
but with the given extension.
See Utf8PathBuf::set_extension
for more details.
Examples
use camino::{Utf8Path, Utf8PathBuf}; let path = Utf8Path::new("foo.rs"); assert_eq!(path.with_extension("txt"), Utf8PathBuf::from("foo.txt")); let path = Utf8Path::new("foo.tar.gz"); assert_eq!(path.with_extension(""), Utf8PathBuf::from("foo.tar")); assert_eq!(path.with_extension("xz"), Utf8PathBuf::from("foo.tar.xz")); assert_eq!(path.with_extension("").with_extension("txt"), Utf8PathBuf::from("foo.txt"));
pub fn components(&self) -> Utf8Components<'_>
[src]
pub fn components(&self) -> Utf8Components<'_>
[src]Produces an iterator over the Utf8Component
s of the path.
When parsing the path, there is a small amount of normalization:
-
Repeated separators are ignored, so
a/b
anda//b
both havea
andb
as components. -
Occurrences of
.
are normalized away, except if they are at the beginning of the path. For example,a/./b
,a/b/
,a/b/.
anda/b
all havea
andb
as components, but./a/b
starts with an additionalCurDir
component. -
A trailing slash is normalized away,
/a/b
and/a/b/
are equivalent.
Note that no other normalization takes place; in particular, a/c
and a/b/../c
are distinct, to account for the possibility that b
is a symbolic link (so its parent isn’t a
).
Examples
use camino::{Utf8Component, Utf8Path}; let mut components = Utf8Path::new("/tmp/foo.txt").components(); assert_eq!(components.next(), Some(Utf8Component::RootDir)); assert_eq!(components.next(), Some(Utf8Component::Normal("tmp"))); assert_eq!(components.next(), Some(Utf8Component::Normal("foo.txt"))); assert_eq!(components.next(), None)
pub fn iter(&self) -> Iter<'_>
[src]
pub fn iter(&self) -> Iter<'_>
[src]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 camino::Utf8Path; let mut it = Utf8Path::new("/tmp/foo.txt").iter(); assert_eq!(it.next(), Some(std::path::MAIN_SEPARATOR.to_string().as_str())); assert_eq!(it.next(), Some("tmp")); assert_eq!(it.next(), Some("foo.txt")); assert_eq!(it.next(), None)
pub fn metadata(&self) -> Result<Metadata, Error>
[src]
pub fn metadata(&self) -> Result<Metadata, Error>
[src]Queries the file system to get information about a file, directory, etc.
This function will traverse symbolic links to query information about the destination file.
This is an alias to fs::metadata
.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/Minas/tirith"); let metadata = path.metadata().expect("metadata call failed"); println!("{:?}", metadata.file_type());
pub fn symlink_metadata(&self) -> Result<Metadata, Error>
[src]
pub fn symlink_metadata(&self) -> Result<Metadata, Error>
[src]Queries the metadata about a file without following symlinks.
This is an alias to fs::symlink_metadata
.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/Minas/tirith"); let metadata = path.symlink_metadata().expect("symlink_metadata call failed"); println!("{:?}", metadata.file_type());
pub fn canonicalize(&self) -> Result<PathBuf, Error>
[src]
pub fn canonicalize(&self) -> Result<PathBuf, Error>
[src]Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.
This returns a PathBuf
because even if a symlink is valid Unicode, its target may not
be.
This is an alias to fs::canonicalize
.
Examples
use camino::Utf8Path; use std::path::PathBuf; let path = Utf8Path::new("/foo/test/../test/bar.rs"); assert_eq!(path.canonicalize().unwrap(), PathBuf::from("/foo/test/bar.rs"));
pub fn read_link(&self) -> Result<PathBuf, Error>
[src]
pub fn read_link(&self) -> Result<PathBuf, Error>
[src]Reads a symbolic link, returning the file that the link points to.
This returns a PathBuf
because even if a symlink is valid Unicode, its target may not
be.
This is an alias to fs::read_link
.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/laputa/sky_castle.rs"); let path_link = path.read_link().expect("read_link call failed");
pub fn read_dir(&self) -> Result<ReadDir, Error>
[src]
pub fn read_dir(&self) -> Result<ReadDir, Error>
[src]Returns an iterator over the entries within a directory.
The iterator will yield instances of io::Result
<
fs::DirEntry
>
. New
errors may be encountered after an iterator is initially constructed.
This is an alias to fs::read_dir
.
Examples
use camino::Utf8Path; let path = Utf8Path::new("/laputa"); for entry in path.read_dir().expect("read_dir call failed") { if let Ok(entry) = entry { println!("{:?}", entry.path()); } }
pub fn exists(&self) -> bool
[src]
pub fn exists(&self) -> bool
[src]Returns true
if the path points at an existing entity.
This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return false
.
If you cannot access the directory containing the file, e.g., because of a
permission error, this will return false
.
Examples
use camino::Utf8Path; assert!(!Utf8Path::new("does_not_exist.txt").exists());
See Also
This is a convenience function that coerces errors to false. If you want to
check errors, call fs::metadata
.
pub fn is_file(&self) -> bool
[src]
pub fn is_file(&self) -> bool
[src]Returns true
if the path exists on disk and is pointing at a regular file.
This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return false
.
If you cannot access the directory containing the file, e.g., because of a
permission error, this will return false
.
Examples
use camino::Utf8Path; assert_eq!(Utf8Path::new("./is_a_directory/").is_file(), false); assert_eq!(Utf8Path::new("a_file.txt").is_file(), true);
See Also
This is a convenience function that coerces errors to false. If you want to
check errors, call fs::metadata
and handle its Result
. Then call
fs::Metadata::is_file
if it was Ok
.
When the goal is simply to read from (or write to) the source, the most
reliable way to test the source can be read (or written to) is to open
it. Only using is_file
can break workflows like diff <( prog_a )
on
a Unix-like system for example. See fs::File::open
or
fs::OpenOptions::open
for more information.
pub fn is_dir(&self) -> bool
[src]
pub fn is_dir(&self) -> bool
[src]Returns true
if the path exists on disk and is pointing at a directory.
This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return false
.
If you cannot access the directory containing the file, e.g., because of a
permission error, this will return false
.
Examples
use camino::Utf8Path; assert_eq!(Utf8Path::new("./is_a_directory/").is_dir(), true); assert_eq!(Utf8Path::new("a_file.txt").is_dir(), false);
See Also
This is a convenience function that coerces errors to false. If you want to
check errors, call fs::metadata
and handle its Result
. Then call
fs::Metadata::is_dir
if it was Ok
.
pub fn into_path_buf(self: Box<Utf8Path, Global>) -> Utf8PathBuf
[src]
pub fn into_path_buf(self: Box<Utf8Path, Global>) -> Utf8PathBuf
[src]Converts a Box<Utf8Path>
into a Utf8PathBuf
without copying or allocating.
Trait Implementations
impl AsRef<Utf8Path> for Utf8PathBuf
[src]
impl AsRef<Utf8Path> for Utf8PathBuf
[src]impl Borrow<Utf8Path> for Utf8PathBuf
[src]
impl Borrow<Utf8Path> for Utf8PathBuf
[src]impl<'de, 'a> Deserialize<'de> for &'a Utf8Path where
'de: 'a,
[src]
impl<'de, 'a> Deserialize<'de> for &'a Utf8Path where
'de: 'a,
[src]pub fn deserialize<D>(
deserializer: D
) -> Result<&'a Utf8Path, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<&'a Utf8Path, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<'a> IntoIterator for &'a Utf8Path
[src]
impl<'a> IntoIterator for &'a Utf8Path
[src]impl Ord for Utf8Path
[src]
impl Ord for Utf8Path
[src]impl<'a, 'b> PartialEq<&'a Utf8Path> for Utf8PathBuf
[src]
impl<'a, 'b> PartialEq<&'a Utf8Path> for Utf8PathBuf
[src]impl<'a, 'b> PartialEq<Utf8Path> for Utf8PathBuf
[src]
impl<'a, 'b> PartialEq<Utf8Path> for Utf8PathBuf
[src]impl<'a, 'b> PartialEq<Utf8PathBuf> for &'a Utf8Path
[src]
impl<'a, 'b> PartialEq<Utf8PathBuf> for &'a Utf8Path
[src]impl<'a, 'b> PartialEq<Utf8PathBuf> for Utf8Path
[src]
impl<'a, 'b> PartialEq<Utf8PathBuf> for Utf8Path
[src]impl<'a, 'b> PartialOrd<&'a OsStr> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<&'a OsStr> for Utf8Path
[src]pub fn partial_cmp(&self, other: &&'a OsStr) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &&'a OsStr) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'a Path> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<&'a Path> for Utf8Path
[src]pub fn partial_cmp(&self, other: &&'a Path) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &&'a Path) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'a Utf8Path> for Utf8PathBuf
[src]
impl<'a, 'b> PartialOrd<&'a Utf8Path> for Utf8PathBuf
[src]pub fn partial_cmp(&self, other: &&'a Utf8Path) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &&'a Utf8Path) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'a str> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<&'a str> for Utf8Path
[src]pub fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Utf8Path>> for &'b Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'a, Utf8Path>> for &'b Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'a, Utf8Path>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'a, Utf8Path>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Utf8Path>> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'a, Utf8Path>> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'a, Utf8Path>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'a, Utf8Path>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, str>> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'a, str>> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'a, str>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'a, str>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'b, OsStr>> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'b, OsStr>> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'b, OsStr>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'b, OsStr>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'b, Path>> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'b, Path>> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'b, Path>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'b, Path>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'b, str>> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<Cow<'b, str>> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &Cow<'b, str>) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Cow<'b, str>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsStr> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<OsStr> for Utf8Path
[src]pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsStr> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<OsStr> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsString> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<OsString> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsString> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<OsString> for Utf8Path
[src]pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Path> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<Path> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Path> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<Path> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<PathBuf> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<PathBuf> for Utf8Path
[src]pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<PathBuf> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<PathBuf> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<String> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<String> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<String> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<String> for Utf8Path
[src]pub fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<Utf8Path> for Utf8Path
[src]
impl PartialOrd<Utf8Path> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Utf8Path) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Utf8Path) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Utf8Path> for Utf8PathBuf
[src]
impl<'a, 'b> PartialOrd<Utf8Path> for Utf8PathBuf
[src]pub fn partial_cmp(&self, other: &Utf8Path) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Utf8Path) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Utf8PathBuf> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<Utf8PathBuf> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &Utf8PathBuf) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Utf8PathBuf) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Utf8PathBuf> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<Utf8PathBuf> for Utf8Path
[src]pub fn partial_cmp(&self, other: &Utf8PathBuf) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &Utf8PathBuf) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<str> for Utf8Path
[src]
impl<'a, 'b> PartialOrd<str> for Utf8Path
[src]pub fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<str> for &'a Utf8Path
[src]
impl<'a, 'b> PartialOrd<str> for &'a Utf8Path
[src]pub fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Serialize for Utf8Path
[src]
impl Serialize for Utf8Path
[src]pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
impl ToOwned for Utf8Path
[src]
impl ToOwned for Utf8Path
[src]type Owned = Utf8PathBuf
type Owned = Utf8PathBuf
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> Utf8PathBuf
[src]
pub fn to_owned(&self) -> Utf8PathBuf
[src]Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut Self::Owned)
[src]
fn clone_into(&self, target: &mut Self::Owned)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more