• Home
  • Raw
  • Download

Lines Matching full:which

1 //! 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> { in which() function
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!") in system_cwd()
291 panic!("which can't use regex and cwd at the same time!") in custom_cwd()
311 panic!("which's regex feature was not enabled in your Cargo.toml!") in regex()
316 panic!("which can't use regex and cwd at the same time!") in regex()
319 panic!("which can't use `binary_name` and `regex` at the same time!"); in regex()
334 panic!("which can't use `binary_name` and `regex` at the same time!"); in binary_name()
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 }) in new()
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) in new()
589 /// Consumes the `which::CanonicalPath`, yielding its underlying `std::path::PathBuf`.