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<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.