Lines Matching refs:Path
106 Option::<&Path>::None,
153 V: AsRef<path::Path>,
206 V: AsRef<path::Path>,
228 finder.find(binary_name, paths, Option::<&Path>::None, binary_checker)
394 /// The constructed `PathBuf` is the output of `which` or `which_in`, but `which::Path` has the
395 /// advantage of being a type distinct from `std::path::Path` and `std::path::PathBuf`.
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.
403 pub struct Path {
407 impl Path {
410 /// This calls `which` and maps the result into a `Path`.
411 pub fn new<T: AsRef<OsStr>>(binary_name: T) -> Result<Path> {
412 which(binary_name).map(|inner| Path { inner })
417 /// this calls `which_all` and maps the results into `Path`s.
418 pub fn all<T: AsRef<OsStr>>(binary_name: T) -> Result<impl Iterator<Item = Path>> {
419 which_all(binary_name).map(|inner| inner.map(|inner| Path { inner }))
425 /// This calls `which_in` and maps the result into a `Path`.
426 pub fn new_in<T, U, V>(binary_name: T, paths: Option<U>, cwd: V) -> Result<Path>
430 V: AsRef<path::Path>,
432 which_in(binary_name, paths, cwd).map(|inner| Path { inner })
438 /// This calls `which_in_all` and maps the results into a `Path`.
443 ) -> Result<impl Iterator<Item = Path>>
447 V: AsRef<path::Path>,
449 which_in_all(binary_name, paths, cwd).map(|inner| inner.map(|inner| Path { inner }))
452 /// Returns a reference to a `std::path::Path`.
453 pub fn as_path(&self) -> &path::Path {
457 /// Consumes the `which::Path`, yielding its underlying `std::path::PathBuf`.
463 impl fmt::Debug for Path {
469 impl std::ops::Deref for Path {
470 type Target = path::Path;
472 fn deref(&self) -> &path::Path {
477 impl AsRef<path::Path> for Path {
478 fn as_ref(&self) -> &path::Path {
483 impl AsRef<OsStr> for Path {
489 impl PartialEq<path::PathBuf> for Path {
495 impl PartialEq<Path> for path::PathBuf {
496 fn eq(&self, other: &Path) -> bool {
505 /// `Path::canonicalize`, but `CanonicalPath` has the advantage of being a type distinct from
506 /// `std::path::Path` and `std::path::PathBuf`.
508 /// It can be beneficial to use `CanonicalPath` instead of `std::path::Path` when you want the type
512 /// Since `CanonicalPath` implements `Deref` for `std::path::Path`, all methods on
513 /// `&std::path::Path` are also available to `&CanonicalPath` values.
522 /// This calls `which` and `Path::canonicalize` and maps the result into a `CanonicalPath`.
531 /// This calls `which_all` and `Path::canonicalize` and maps the results into `CanonicalPath`s.
548 /// This calls `which_in` and `Path::canonicalize` and maps the result into a `CanonicalPath`.
553 V: AsRef<path::Path>,
563 /// This calls `which_in_all` and `Path::canonicalize` and maps the result into a `CanonicalPath`.
572 V: AsRef<path::Path>,
584 /// Returns a reference to a `std::path::Path`.
585 pub fn as_path(&self) -> &path::Path {
602 type Target = path::Path;
604 fn deref(&self) -> &path::Path {
609 impl AsRef<path::Path> for CanonicalPath {
610 fn as_ref(&self) -> &path::Path {