#which #unix


An async implementation of which

9 releases

0.3.4 Apr 21, 2020
0.3.3 Apr 18, 2020
0.3.1 Jan 31, 2020
0.2.2 Jan 13, 2020
0.1.3 Dec 30, 2019

#42 in Filesystem

Download history 920/week @ 2020-05-26 787/week @ 2020-06-02 1342/week @ 2020-06-09 985/week @ 2020-06-16 1009/week @ 2020-06-23 1398/week @ 2020-06-30 908/week @ 2020-07-07 1411/week @ 2020-07-14 1109/week @ 2020-07-21 769/week @ 2020-07-28 581/week @ 2020-08-04 1538/week @ 2020-08-11 888/week @ 2020-08-18 1668/week @ 2020-08-25 1170/week @ 2020-09-01 825/week @ 2020-09-08

3,211 downloads per month
Used in 2 crates (via nu-cli)

MIT license

706 lines

ichwh - an async implementation of GNU which

Crates.io Gitlab pipeline status Docs.rs AppVeyor

ichwh aims to be a fully-async clone of GNU which, compatible with the three major operating systems. The main job of which is to search for executables on the current PATH.

This crate is similar to the synchronous which crate. The main difference is that ichwh is asynchronous, and provides a which_all method.


In Cargo.toml:

ichwh = "*"

In your source files:

use ichwh::which;

let path_to_python = which("python").await.unwrap();
assert_eq!(path_to_python.to_str().unwrap(), "/usr/bin/python");


Run tests with cargo test. The tests will create a set of temporary test folders. They are rooted at /tmp/ichwh-test-<num> (%TEMP%/... on windows), where <num> is the number of minutes since the unix epoch. If all tests pass, the folders will be cleaned up. Any failing tests will preserve their test folders for inspection and debugging.



This crate adheres to SemVer. This crate is pre-1.0, meaning that breaking changes to the publicly-documented API will bump the minor version, and non-breaking changes will bump the patch version.

All publicly-documented items in this crate (i.e., items visible for a platform on docs.rs) are considered stable until a breaking version increment. Do not depend on or use non-documented items that may be visible in-code; they may change at any time.

Please report any unexpected API breakage as a bug.




~62K SLoC