diff options
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index bb60cc7..4f6cef0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -90,7 +90,21 @@ impl Sandbox { } } + /// Validation consults it; the fixture-bound tests that assert it are the only outside readers. + /// + /// Module-internal in a production build, `pub` only under `test-support`: + /// one body behind two visibility declarations, exactly one of which compiles. + #[cfg(feature = "test-support")] pub fn shared_workspace(&self) -> bool { + Self::shared_workspace_impl(self) + } + + #[cfg(not(feature = "test-support"))] + pub(crate) fn shared_workspace(&self) -> bool { + Self::shared_workspace_impl(self) + } + + fn shared_workspace_impl(&self) -> bool { match self { Sandbox::Loopback => true, Sandbox::Remote { shared_workspace, .. } => *shared_workspace, @@ -354,7 +368,21 @@ impl Config { pub fn staging_build_dir(&self, build_id: &str) -> PathBuf { self.staging_dir().join(build_id) } + /// The content-addressed store layout is this module's own business; a test pins where a blob lands. + /// + /// Module-internal in a production build, `pub` only under `test-support`: + /// one body behind two visibility declarations, exactly one of which compiles. + #[cfg(feature = "test-support")] pub fn store_dir(&self) -> PathBuf { + Self::store_dir_impl(self) + } + + #[cfg(not(feature = "test-support"))] + pub(crate) fn store_dir(&self) -> PathBuf { + Self::store_dir_impl(self) + } + + fn store_dir_impl(&self) -> PathBuf { self.root.join("store") } pub fn store_path(&self, digest: &str) -> PathBuf { |
