Crate which

Source
Expand description

which

A Rust equivalent of Unix command which(1).

§Example:

To find which rustc executable binary is using:

use which::which;
use std::path::PathBuf;

let result = which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));

Structs§

CanonicalPath
An owned, immutable wrapper around a PathBuf containing the canonical path of an executable.
Noop
A handler for non-fatal errors which does nothing with them.
Path
An owned, immutable wrapper around a PathBuf containing the path of an executable.
WhichConfig
A wrapper containing all functionality in this crate.

Enums§

Error
NonFatalError

Traits§

NonFatalErrorHandler
Defines what should happen when a nonfatal error is encountered. A nonfatal error may represent a problem, but it doesn’t necessarily require which to stop its search.

Functions§

which
Find an executable binary’s path by name.
which_all
Find all binaries with binary_name using cwd to resolve relative paths.
which_all_global
Find all binaries with binary_name ignoring cwd.
which_global
Find an executable binary’s path by name, ignoring cwd.
which_in
Find binary_name in the path list paths, using cwd to resolve relative paths.
which_in_all
Find all binaries with binary_name in the path list paths, using cwd to resolve relative paths.
which_in_global
Find all binaries with binary_name in the path list paths, ignoring cwd.
which_re
Find all binaries matching a regular expression in a the system PATH.
which_re_in
Find all binaries matching a regular expression in a list of paths.

Type Aliases§

Result