pub struct ParameterSpace { /* private fields */ }Expand description
A validated immutable fixed-and-swept parameter definition.
Cloning this type clones only an Arc. Parsed source values, lookup
indexes, Cartesian strides, explicit cases, and exact source bytes remain in
one shared allocation.
Implementations§
Source§impl ParameterSpace
impl ParameterSpace
Sourcepub fn load(
configuration_directory: impl Into<PathBuf>,
) -> Result<Self, ConfigurationError>
pub fn load( configuration_directory: impl Into<PathBuf>, ) -> Result<Self, ConfigurationError>
Loads fixed.json and sweep.json from configuration_directory.
The directory is the config/ directory itself. The later
ProjectConfig facade accepts a project root and applies that standard
suffix automatically.
§Errors
Returns contextual IO or JSON errors, duplicate-key and document-shape errors, fixed/sweep collisions, empty sweep definitions, or checked task count overflow. Neither source file is modified.
Sourcepub fn configuration_directory(&self) -> &Path
pub fn configuration_directory(&self) -> &Path
Returns the configuration directory exactly as supplied at load time.
Sourcepub fn fixed_source_json(&self) -> &[u8] ⓘ
pub fn fixed_source_json(&self) -> &[u8] ⓘ
Borrows the validated original bytes of fixed.json unchanged.
These bytes include the source document’s original whitespace, key presentation order, and number spelling.
Sourcepub fn sweep_source_json(&self) -> &[u8] ⓘ
pub fn sweep_source_json(&self) -> &[u8] ⓘ
Borrows the validated original bytes of sweep.json unchanged.
Sourcepub fn fixed_parameter_count(&self) -> usize
pub fn fixed_parameter_count(&self) -> usize
Returns the number of names supplied by fixed.json.
Sourcepub fn sweep_parameter_count(&self) -> usize
pub fn sweep_parameter_count(&self) -> usize
Returns the number of names supplied by one resolved sweep selection.
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Returns the number of entries in every resolved task dictionary.
Sourcepub fn task_count(&self) -> u64
pub fn task_count(&self) -> u64
Returns the exact checked number of deterministic task combinations.
Sourcepub fn contains_parameter(&self, key: &str) -> bool
pub fn contains_parameter(&self, key: &str) -> bool
Reports whether either the fixed table or sweep definition declares an exact parameter key.
Sourcepub fn fixed_keys(&self) -> impl ExactSizeIterator<Item = &str>
pub fn fixed_keys(&self) -> impl ExactSizeIterator<Item = &str>
Iterates fixed parameter names in their JSON declaration order.
Sourcepub fn sweep_keys(&self) -> impl ExactSizeIterator<Item = &str>
pub fn sweep_keys(&self) -> impl ExactSizeIterator<Item = &str>
Iterates swept parameter names in declared axis or first-case order.
Sourcepub fn task(&self, ordinal: u64) -> Result<TaskParameters, ConfigurationError>
pub fn task(&self, ordinal: u64) -> Result<TaskParameters, ConfigurationError>
Resolves one zero-based deterministic task ordinal.
The returned dictionary shares this space’s allocation and computes selected values lazily during lookup. No parameter value is cloned.
Sourcepub fn tasks(&self) -> TaskParametersIter ⓘ
pub fn tasks(&self) -> TaskParametersIter ⓘ
Iterates every resolved task in increasing deterministic ordinal order.
Iterator items cannot fail because the range is constructed from the already validated task count.
Trait Implementations§
Source§impl Clone for ParameterSpace
impl Clone for ParameterSpace
Source§fn clone(&self) -> ParameterSpace
fn clone(&self) -> ParameterSpace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more