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 Paths.

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.

Returns a reference to a std::path::Path.

Consumes the which::Path, yielding its underlying std::path::PathBuf.

Trait Implementations

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.