Lines Matching defs:which

0 //! which
3 //! A Rust equivalent of Unix command `which(1)`.
6 //! To find which rustc executable binary is using:
9 //! use which::which;
12 //! let result = which("rustc").unwrap();
49 /// use which::which;
52 /// let result = which::which("rustc").unwrap();
56 pub fn which<T: AsRef<OsStr>>(binary_name: T) -> Result<path::PathBuf> {
73 /// use which::which;
76 /// let result = which::which_global("rustc").unwrap();
125 /// use which::which;
129 /// let binaries: Vec<PathBuf> = which::which_re(re).unwrap().collect();
137 /// use which::which_re;
173 /// use which::which;
178 /// let binaries: Vec<PathBuf> = which::which_re_in(re, paths).unwrap().collect();
277 panic!("which can't use regex and cwd at the same time!")
291 panic!("which can't use regex and cwd at the same time!")
311 panic!("which's regex feature was not enabled in your Cargo.toml!")
316 panic!("which can't use regex and cwd at the same time!")
319 panic!("which can't use `binary_name` and `regex` at the same time!");
334 panic!("which can't use `binary_name` and `regex` at the same time!");
394 /// The constructed `PathBuf` is the output of `which` or `which_in`, but `which::Path` has the
397 /// It can be beneficial to use `which::Path` instead of `std::path::Path` when you want the type
400 /// Since `which::Path` implements `Deref` for `std::path::Path`, all methods on `&std::path::Path`
401 /// are also available to `&which::Path` values.
410 /// This calls `which` and maps the result into a `Path`.
412 which(binary_name).map(|inner| Path { inner })
457 /// Consumes the `which::Path`, yielding its underlying `std::path::PathBuf`.
504 /// The constructed `PathBuf` is the result of `which` or `which_in` followed by
522 /// This calls `which` and `Path::canonicalize` and maps the result into a `CanonicalPath`.
524 which(binary_name)
589 /// Consumes the `which::CanonicalPath`, yielding its underlying `std::path::PathBuf`.