pub struct ProjectConfig { /* private fields */ }Expand description
Complete validated configuration for one scientific project.
This facade keeps fixed/sweep expansion and path resolution distinct while
guaranteeing that both were loaded from the same standard project root.
Cloning it is lightweight because the component values share their parsed
allocations through std::sync::Arc.
Implementations§
Source§impl ProjectConfig
impl ProjectConfig
Sourcepub fn load(
project_root: impl Into<PathBuf>,
) -> Result<Self, ConfigurationError>
pub fn load( project_root: impl Into<PathBuf>, ) -> Result<Self, ConfigurationError>
Loads all three standard JSON files beneath project_root/config.
Loading is read-only. The supplied project root is retained without canonicalization, and no configured path target needs to exist.
§Errors
Returns the precise ConfigurationError produced by fixed/sweep
loading or path loading. A caller never receives a partially validated
ProjectConfig.
Sourcepub fn project_root(&self) -> &Path
pub fn project_root(&self) -> &Path
Returns the project root exactly as supplied at load time.
Sourcepub fn configuration_directory(&self) -> &Path
pub fn configuration_directory(&self) -> &Path
Returns the standard config/ directory derived from the project root.
Sourcepub fn parameters(&self) -> &ParameterSpace
pub fn parameters(&self) -> &ParameterSpace
Borrows the validated fixed-and-swept parameter space.
Sourcepub fn paths(&self) -> &ProjectPaths
pub fn paths(&self) -> &ProjectPaths
Borrows the validated named project-path dictionary.
Sourcepub fn into_parts(self) -> (ParameterSpace, ProjectPaths)
pub fn into_parts(self) -> (ParameterSpace, ProjectPaths)
Consumes the facade and returns its parameter and path components.
Both returned handles retain their shared source allocations. No source bytes, parsed JSON values, path values, or task parameters are cloned.
Sourcepub fn write_source_config(
&self,
destination_project_root: impl AsRef<Path>,
) -> Result<(), ConfigurationError>
pub fn write_source_config( &self, destination_project_root: impl AsRef<Path>, ) -> Result<(), ConfigurationError>
Writes an exact non-overwriting copy beneath destination_project_root.
The destination root is created when absent. Publication refuses an
existing config/ path. All three files are created exclusively from
the original validated byte slices and synchronized before directory
publication is considered durable.
§Errors
Any root creation, exclusive configuration/file creation, write, or
sync failure is returned as
ConfigurationError::WriteConfigurationFile with the exact path at
which it occurred. Existing destination data is never overwritten.
Trait Implementations§
Source§impl Clone for ProjectConfig
impl Clone for ProjectConfig
Source§fn clone(&self) -> ProjectConfig
fn clone(&self) -> ProjectConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more