pub 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
└── grandchildA 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
└── grandchildA 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.
pub fn get_path(&self) -> &Path
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
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§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