pub struct TvixStoreIO {
pub(crate) simulated_store: SimulatedStoreIO,
pub known_paths: RefCell<KnownPaths>,
}Expand description
Implements EvalIO, asking given [PathInfoService], [DirectoryService] and [BlobService].
In case the given path does not exist in these stores, we ask StdIO. This is to both cover cases of syntactically valid store paths, that exist on the filesystem (still managed by Nix), as well as being able to read files outside store paths.
This structure is also directly used by the derivation builtins and tightly coupled to it.
In the future, we may revisit that coupling and figure out how to generalize this interface and hide this implementation detail of the glue itself so that glue can be used with more than one implementation of “Tvix Store IO” which does not necessarily bring the concept of blob service, directory service or path info service.
Fields§
§simulated_store: SimulatedStoreIO§known_paths: RefCell<KnownPaths>Implementations§
Source§impl TvixStoreIO
impl TvixStoreIO
pub fn new(simulated_store: SimulatedStoreIO) -> Self
Trait Implementations§
Source§impl EvalIO for TvixStoreIO
impl EvalIO for TvixStoreIO
Source§fn path_exists(&self, path: &Path) -> Result<bool>
fn path_exists(&self, path: &Path) -> Result<bool>
Verify whether the file at the specified path exists. Read more
Source§fn open(&self, path: &Path) -> Result<Box<dyn Read>>
fn open(&self, path: &Path) -> Result<Box<dyn Read>>
Open the file at the specified path to a
io::Read.Source§fn file_type(&self, path: &Path) -> Result<FileType>
fn file_type(&self, path: &Path) -> Result<FileType>
Return the FileType of the given path, or an error if it doesn’t
exist.
Auto Trait Implementations§
impl !Freeze for TvixStoreIO
impl !RefUnwindSafe for TvixStoreIO
impl Send for TvixStoreIO
impl !Sync for TvixStoreIO
impl Unpin for TvixStoreIO
impl UnwindSafe for TvixStoreIO
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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