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::which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));

Structs§

  • An owned, immutable wrapper around a PathBuf containing the canonical path of an executable.
  • An owned, immutable wrapper around a PathBuf containing the path of an executable.

Enums§

Functions§

  • Find a exectable binary’s path by name.
  • Find all binaries with binary_name in the path list paths, using cwd to resolve relative paths.
  • Find binary_name in the path list paths, using cwd to resolve relative paths.
  • Find all binaries with binary_name in the path list paths, using cwd to resolve relative paths.

Type Aliases§