struct ImportCache(FxHashMap<PathBuf, Value>);Tuple Fields§
§0: FxHashMap<PathBuf, Value>Implementations§
Source§impl ImportCache
The ImportCache holds the Value resulting from importing a certain
file, so that the same file doesn’t need to be re-evaluated multiple times.
Currently the real path of the imported file (determined using
std::fs::canonicalize(), not to be confused with our
crate::value::canon_path()) is used to identify the file,
just like C++ Nix does.
impl ImportCache
The ImportCache holds the Value resulting from importing a certain
file, so that the same file doesn’t need to be re-evaluated multiple times.
Currently the real path of the imported file (determined using
std::fs::canonicalize(), not to be confused with our
crate::value::canon_path()) is used to identify the file,
just like C++ Nix does.
Errors while determining the real path are currently just ignored, since we
pass around some fake paths like /__corepkgs__/fetchurl.nix.
In the future, we could use something more sophisticated, like file hashes.
However, a consideration is that the eval cache is observable via impurities
like pointer equality and builtins.trace.
Trait Implementations§
Source§impl Default for ImportCache
impl Default for ImportCache
Source§fn default() -> ImportCache
fn default() -> ImportCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ImportCache
impl !RefUnwindSafe for ImportCache
impl !Send for ImportCache
impl !Sync for ImportCache
impl Unpin for ImportCache
impl !UnwindSafe for ImportCache
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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