pub struct StorageManager { /* private fields */ }Expand description
Owns the set of declared storage items for a single workflow run and
routes operations to the appropriate backend. Built once in
[crate::run::execute] and threaded through to every step.
Implementations§
Source§impl StorageManager
impl StorageManager
Sourcepub fn build(
storage: &HashMap<String, StorageSpec>,
backend: FilesystemBackend,
) -> Result<Self, ZigError>
pub fn build( storage: &HashMap<String, StorageSpec>, backend: FilesystemBackend, ) -> Result<Self, ZigError>
Build a manager from the workflow’s storage table, wiring every
entry to a shared FilesystemBackend. Calls ensure on each
item so downstream steps can trust that the path is live.
Sourcepub fn build_dry(
storage: &HashMap<String, StorageSpec>,
backend: FilesystemBackend,
) -> Self
pub fn build_dry( storage: &HashMap<String, StorageSpec>, backend: FilesystemBackend, ) -> Self
Build a manager without calling ensure on its backends.
Used by --dry-run: the <storage> block still renders with the
correct absolute paths, but no directories or files are created on
disk. The live <contents> listing will reflect whatever happens to
be on disk already (or be empty) rather than the state a real run
would produce — an acceptable trade-off for a preview.
Sourcepub fn iter(&self) -> impl Iterator<Item = &StorageItem>
pub fn iter(&self) -> impl Iterator<Item = &StorageItem>
Iterate over every declared item, regardless of scoping.
Sourcepub fn items_for_step(&self, scope: Option<&[String]>) -> Vec<&StorageItem>
pub fn items_for_step(&self, scope: Option<&[String]>) -> Vec<&StorageItem>
Return the items a step is allowed to see, applying the step’s
storage scoping field.
scope = None(field omitted) → every declared item.scope = Some(&[])→ no items.scope = Some(names)→ only items whose name appears innames.