Struct which::CanonicalPath [−][src]
pub struct CanonicalPath { /* fields omitted */ }
Expand description
An owned, immutable wrapper around a PathBuf
containing the canonical path of an
executable.
The constructed PathBuf
is the result of which
or which_in
followed by
Path::canonicalize
, but CanonicalPath
has the advantage of being a type distinct from
std::path::Path
and std::path::PathBuf
.
It can be beneficial to use CanonicalPath
instead of std::path::Path
when you want the type
system to enforce the need for a path that exists, points to a binary that is executable, is
absolute, has all components normalized, and has all symbolic links resolved
Since CanonicalPath
implements Deref
for std::path::Path
, all methods on
&std::path::Path
are also available to &CanonicalPath
values.
Implementations
Returns the canonical path of an executable binary by name.
This calls which
and Path::canonicalize
and maps the result into a CanonicalPath
.
Returns the canonical paths of an executable binary by name.
This calls which_all
and Path::canonicalize
and maps the results into CanonicalPath
s.
Returns the canonical path of an executable binary by name in the path list paths
and
using the current working directory cwd
to resolve relative paths.
This calls which_in
and Path::canonicalize
and maps the result into a CanonicalPath
.
Returns all of the canonical paths of an executable binary by name in the path list paths
and
using the current working directory cwd
to resolve relative paths.
This calls which_in_all
and Path::canonicalize
and maps the result into a CanonicalPath
.
Consumes the which::CanonicalPath
, yielding its underlying std::path::PathBuf
.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for CanonicalPath
impl Send for CanonicalPath
impl Sync for CanonicalPath
impl Unpin for CanonicalPath
impl UnwindSafe for CanonicalPath
Blanket Implementations
Mutably borrows from an owned value. Read more