Struct SimulatedStoreIO

Source
pub struct SimulatedStoreIO {
    pub(crate) store_dir: String,
    pub(crate) passthru_paths: RefCell<HashMap<[u8; 20], PathBuf>>,
}

Fields§

§store_dir: String§passthru_paths: RefCell<HashMap<[u8; 20], PathBuf>>

Implementations§

Source§

impl SimulatedStoreIO

Source

pub fn add_passthru(&mut self, path: &str, loc: PathBuf) -> Result<()>

Adds a passthru path, mapping the given path to the given location on the filesystem.

Using this incorrectly can lead to incomprehensible breakage.

Source§

impl SimulatedStoreIO

Source

pub(crate) fn to_readable_path<'a>( &self, path: &'a Path, ) -> Result<Cow<'a, Path>>

Returns a path from which StdIO can read, unless realisation is required (which the simulated store does not support).

Source

pub fn import_path_by_entries<I, E>( &self, name: &str, entries: I, expected_sha256: Option<[u8; 32]>, ) -> Result<StorePath<String>>
where Error: From<E>, I: Iterator<Item = Result<DirEntry, E>>,

Trait Implementations§

Source§

impl Default for SimulatedStoreIO

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl EvalIO for SimulatedStoreIO

Source§

fn store_dir(&self) -> Option<String>

Returns the root of the store directory, if such a thing exists in the evaluation context. Read more
Source§

fn import_path(&self, path: &Path) -> Result<PathBuf>

Import the given path. What this means depends on the implementation, for example for a std::io-based implementation this might be a no-op, while for a Tvix store this might be a copy of the given files to the store. Read more
Source§

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

Open the file at the specified path to a io::Read.
Source§

fn file_type(&self, path: &Path) -> Result<FileType>

Return the FileType of the given path, or an error if it doesn’t exist.
Source§

fn read_dir(&self, path: &Path) -> Result<Vec<(Bytes, FileType)>>

Read the directory at the specified path and return the names of its entries associated with their FileType. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more