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"));Modules§
Structs§
- Canonical
Path - An owned, immutable wrapper around a
PathBufcontaining 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
PathBufcontaining the path of an executable. - Which
Config - A wrapper containing all functionality in this crate.
Enums§
Traits§
- NonFatal
Error Handler - Defines what should happen when a nonfatal error is encountered. A nonfatal error may represent a problem,
but it doesn’t necessarily require
whichto stop its search.
Functions§
- which
- Find an executable binary’s path by name.
- which_
all - Find all binaries with
binary_nameusingcwdto resolve relative paths. - which_
all_ global - Find all binaries with
binary_nameignoringcwd. - which_
global - Find an executable binary’s path by name, ignoring
cwd. - which_
in - Find
binary_namein the path listpaths, usingcwdto resolve relative paths. - which_
in_ all - Find all binaries with
binary_namein the path listpaths, usingcwdto resolve relative paths. - which_
in_ global - Find all binaries with
binary_namein the path listpaths, ignoringcwd.