pub struct TaskConfig { /* private fields */ }Expand description
One complete immutable task configuration.
This is an owned handle rather than an owned copy of configuration data.
TaskParameters shares fixed/sweep storage and ProjectPaths shares
path storage through independent std::sync::Arc allocations, making a
TaskConfig cheap to move into worker queues and safe to retain after the
originating ProjectConfig is dropped.
Implementations§
Source§impl TaskConfig
impl TaskConfig
Sourcepub fn task_ordinal(&self) -> u64
pub fn task_ordinal(&self) -> u64
Returns the stable zero-based task ordinal.
Sourcepub fn parameters(&self) -> &TaskParameters
pub fn parameters(&self) -> &TaskParameters
Borrows the fixed-plus-selected-sweep dictionary.
Sourcepub fn paths(&self) -> &ProjectPaths
pub fn paths(&self) -> &ProjectPaths
Borrows the shared project path dictionary.
Sourcepub fn value(&self, key: &str) -> Option<&Value>
pub fn value(&self, key: &str) -> Option<&Value>
Borrows one fixed or selected sweep value by exact key.
Sourcepub fn require_value(&self, key: &str) -> Result<&Value, ConfigurationError>
pub fn require_value(&self, key: &str) -> Result<&Value, ConfigurationError>
Borrows one required fixed or selected sweep value.
Sourcepub fn decode_value<T>(&self, key: &str) -> Result<T, ConfigurationError>where
T: DeserializeOwned,
pub fn decode_value<T>(&self, key: &str) -> Result<T, ConfigurationError>where
T: DeserializeOwned,
Decodes one required parameter into the requested concrete Rust type.
Sourcepub fn decode_values<Values, Keys>(
&self,
keys: Keys,
) -> Result<Values, ConfigurationError>where
Keys: ParameterKeyTuple<Values>,
pub fn decode_values<Values, Keys>(
&self,
keys: Keys,
) -> Result<Values, ConfigurationError>where
Keys: ParameterKeyTuple<Values>,
Decodes several required parameters into a heterogeneous tuple.
Sourcepub fn resolve_path(&self, key: &str) -> Result<PathBuf, ConfigurationError>
pub fn resolve_path(&self, key: &str) -> Result<PathBuf, ConfigurationError>
Resolves one named path lexically against the project root.
Sourcepub fn resolved_json(&self) -> Value
pub fn resolved_json(&self) -> Value
Materializes the complete resolved task configuration as canonical JSON.
Parameters retain their nested fixed-plus-sweep shape. Project paths
retain the exact strings declared in paths.json; they are not
canonicalized or resolved against the host filesystem.
Sourcepub fn write_resolved_json(
&self,
path: impl AsRef<Path>,
) -> Result<(), ConfigurationError>
pub fn write_resolved_json( &self, path: impl AsRef<Path>, ) -> Result<(), ConfigurationError>
Writes this resolved configuration as deterministic pretty JSON.
An existing byte-identical file is reused. Different existing content is rejected and never overwritten.
Trait Implementations§
Source§impl Clone for TaskConfig
impl Clone for TaskConfig
Source§fn clone(&self) -> TaskConfig
fn clone(&self) -> TaskConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more