Struct tvix_eval::vm::ImportCache
source · struct ImportCache(HashMap<PathBuf, Value>);
Tuple Fields§
§0: HashMap<PathBuf, Value>
Implementations§
source§impl ImportCache
impl ImportCache
The ImportCache
holds the Value
resulting from import
ing 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