Struct which::Path [−][src]
pub struct Path { /* fields omitted */ }
Expand description
An owned, immutable wrapper around a PathBuf
containing the path of an executable.
The constructed PathBuf
is the output of which
or which_in
, but which::Path
has the
advantage of being a type distinct from std::path::Path
and std::path::PathBuf
.
It can be beneficial to use which::Path
instead of std::path::Path
when you want the type
system to enforce the need for a path that exists and points to a binary that is executable.
Since which::Path
implements Deref
for std::path::Path
, all methods on &std::path::Path
are also available to &which::Path
values.
Implementations
Returns the path of an executable binary by name.
This calls which
and maps the result into a Path
.
Returns the paths of all executable binaries by a name.
this calls which_all
and maps the results into Path
s.
Returns the 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 maps the result into a Path
.
Returns all 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 maps the results into a Path
.
Consumes the which::Path
, yielding its underlying std::path::PathBuf
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Path
impl UnwindSafe for Path
Blanket Implementations
Mutably borrows from an owned value. Read more