ichwh

Crates.ioichwh
lib.rsichwh
version0.3.4
sourcesrc
created_at2019-12-27 00:04:44.283172
updated_at2020-04-21 17:11:11.163869
descriptionAn async implementation of `which`
homepage
repositoryhttps://gitlab.com/avandesa/ichwh-rs
max_upload_size
id192566
size51,799
Alex van de Sandt (avandesa)

documentation

README

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.

Usage

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");

Testing

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.

Changelog

Versioning

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.

Contributing

See CONTRIBUTING.md.

Commit count: 64

cargo fmt