pub struct WorkflowBundle {
pub name: String,
pub version: String,
pub steps: Vec<BundleStep>,
pub metadata: HashMap<String, String>,
}Expand description
A portable, self-contained workflow definition.
Fields§
§name: StringHuman-readable name for the workflow.
version: StringSemantic version string (e.g. "1.0.0").
steps: Vec<BundleStep>Ordered list of processing steps.
metadata: HashMap<String, String>Arbitrary key/value metadata (author, description, tags, …).
Implementations§
Source§impl WorkflowBundle
impl WorkflowBundle
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Serialize this bundle to a compact JSON string.
The output can be fed back into WorkflowBundle::from_json for a
lossless round-trip.
Sourcepub fn from_json(s: &str) -> Result<Self, String>
pub fn from_json(s: &str) -> Result<Self, String>
Deserialize a bundle from a JSON string produced by WorkflowBundle::to_json.
§Errors
Returns a descriptive error string if required fields are missing or cannot be parsed.
Sourcepub fn validate(&self) -> Result<(), Vec<String>>
pub fn validate(&self) -> Result<(), Vec<String>>
Validate the bundle, checking for:
- Duplicate step IDs.
- Dependency references to unknown step IDs.
Returns Ok(()) when all checks pass, or Err(errors) where errors
is a non-empty list of human-readable problem descriptions.
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create an empty bundle with the given name and version "1.0.0".
Sourcepub fn add_workflow(&mut self, workflow: WorkflowBundle)
pub fn add_workflow(&mut self, workflow: WorkflowBundle)
Add a sub-workflow by embedding its steps into this bundle.
Steps from workflow are appended to this bundle’s step list.
If a step ID already exists in this bundle it is suffixed with
"_<n>" to avoid collisions.
Sourcepub fn export_json(&self) -> String
pub fn export_json(&self) -> String
Serialize this bundle to JSON — alias for Self::to_json.
Provided so the task-specified API export_json() is available.
Trait Implementations§
Source§impl Clone for WorkflowBundle
impl Clone for WorkflowBundle
Source§fn clone(&self) -> WorkflowBundle
fn clone(&self) -> WorkflowBundle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowBundle
impl Debug for WorkflowBundle
impl Eq for WorkflowBundle
Source§impl PartialEq for WorkflowBundle
impl PartialEq for WorkflowBundle
impl StructuralPartialEq for WorkflowBundle
Auto Trait Implementations§
impl Freeze for WorkflowBundle
impl RefUnwindSafe for WorkflowBundle
impl Send for WorkflowBundle
impl Sync for WorkflowBundle
impl Unpin for WorkflowBundle
impl UnsafeUnpin for WorkflowBundle
impl UnwindSafe for WorkflowBundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.