enum NixSearchPathEntry {
Path(PathBuf),
Prefix {
prefix: PathBuf,
path: PathBuf,
},
}
Variants§
Path(PathBuf)
Resolve subdirectories of this path within <...>
brackets. This
corresponds to bare paths within the NIX_PATH
environment variable
For example, with NixSearchPathEntry::Path("/example")
and the following
directory structure:
example
└── subdir
└── grandchild
A Nix path literal <subdir>
would resolve to /example/subdir
, and a
Nix path literal <subdir/grandchild>
would resolve to
/example/subdir/grandchild
Prefix
Resolve paths starting with prefix
as subdirectories of path
. This
corresponds to prefix=path
within the NIX_PATH
environment variable.
For example, with NixSearchPathEntry::Prefix { prefix: "prefix", path: "/example" }
and the following directory structure:
example
└── subdir
└── grandchild
A Nix path literal <prefix/subdir>
would resolve to /example/subdir
,
and a Nix path literal <prefix/subdir/grandchild>
would resolve to
/example/subdir/grandchild
Implementations§
source§impl NixSearchPathEntry
impl NixSearchPathEntry
sourcefn resolve<IO>(
&self,
io: IO,
lookup_path: &Path,
) -> Result<Option<PathBuf>, ErrorKind>
fn resolve<IO>( &self, io: IO, lookup_path: &Path, ) -> Result<Option<PathBuf>, ErrorKind>
Determine whether this path entry matches the given lookup path.
For bare paths, an entry is considered to match if a matching file exists under it.
For prefixed path, an entry matches if the prefix does.
Trait Implementations§
source§impl Clone for NixSearchPathEntry
impl Clone for NixSearchPathEntry
source§fn clone(&self) -> NixSearchPathEntry
fn clone(&self) -> NixSearchPathEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NixSearchPathEntry
impl Debug for NixSearchPathEntry
source§impl FromStr for NixSearchPathEntry
impl FromStr for NixSearchPathEntry
source§impl PartialEq for NixSearchPathEntry
impl PartialEq for NixSearchPathEntry
source§fn eq(&self, other: &NixSearchPathEntry) -> bool
fn eq(&self, other: &NixSearchPathEntry) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for NixSearchPathEntry
impl StructuralPartialEq for NixSearchPathEntry
Auto Trait Implementations§
impl Freeze for NixSearchPathEntry
impl RefUnwindSafe for NixSearchPathEntry
impl Send for NixSearchPathEntry
impl Sync for NixSearchPathEntry
impl Unpin for NixSearchPathEntry
impl UnwindSafe for NixSearchPathEntry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more