pub struct ResourceCollector<'a> {
pub workflow_resources: &'a [ResourceSpec],
pub workflow_dir: &'a Path,
pub global_shared_dir: Option<PathBuf>,
pub global_workflow_dir: Option<PathBuf>,
pub cwd_resources_dir: Option<PathBuf>,
pub disabled: bool,
}Expand description
Run-time configuration for resource collection, built once per workflow
invocation in crate::run::run_workflow and threaded through to every
step.
Holds pre-resolved tier directories so tests can construct collectors
directly without mutating $HOME. Use ResourceCollector::from_env
at runtime to populate the directories from crate::paths.
Fields§
§workflow_resources: &'a [ResourceSpec]Inline workflow-level resources from the .zwf file.
workflow_dir: &'a PathDirectory the .zwf file lives in — relative paths in inline specs
are resolved against this.
~/.zig/resources/_shared/, when present.
global_workflow_dir: Option<PathBuf>~/.zig/resources/<workflow-name>/, when present.
cwd_resources_dir: Option<PathBuf><git-root>/.zig/resources/, when present.
disabled: boolWhen true, all tiers are skipped and collect_for_step returns an
empty set. Set by --no-resources on zig run.
Implementations§
Source§impl<'a> ResourceCollector<'a>
impl<'a> ResourceCollector<'a>
Sourcepub fn from_env(
workflow_name: &str,
workflow_resources: &'a [ResourceSpec],
workflow_dir: &'a Path,
disabled: bool,
) -> Self
pub fn from_env( workflow_name: &str, workflow_resources: &'a [ResourceSpec], workflow_dir: &'a Path, disabled: bool, ) -> Self
Build a collector for a workflow at runtime, populating tier
directories from the user’s $HOME and current working directory.
Sourcepub fn collect_for_step(
&self,
step_resources: &[ResourceSpec],
) -> Result<ResourceSet, ZigError>
pub fn collect_for_step( &self, step_resources: &[ResourceSpec], ) -> Result<ResourceSet, ZigError>
Build the merged resource set for a single step, walking all tiers in declaration order.