pub struct Step {
pub name: Option<String>,
pub uses: Option<String>,
pub exec: Option<String>,
pub with: Option<HashMap<String, String>>,
}
Expand description
Step represent a single, instruction in the Workflow
Like a workflow, a step is mainly defined in two parts:
- The metadata: step name
- The instructions: the command to run, the parameters, etc…
There’s two kind of steps currently existing:
§The executable step
A step is executable if it can be executed directly (i.e if a command is defined on the step)
use workflow::Step;
use std::collections::HashMap;
let step = Step {
name: Some("Test step".to_string()),
uses: None,
exec: Some("echo {name}".to_string()),
with: Some(HashMap::default()),
};
assert!(step.executable());
§The referral step
A step is referral if it cannot be executed directly, but rather call another workflow to perform the job.
use workflow::Step;
use std::collections::HashMap;
let step = Step {
name: Some("Test step".to_string()),
uses: Some("std-download".to_string()), // The workflow to run
exec: None,
with: Some(HashMap::default()),
};
assert!(!step.executable());
The referral system allows to build complex workflow while not re-inventing existing but rathers use already defined workflow.
Fields§
§name: Option<String>
The optional step name.
uses: Option<String>
The id of the workflow to be executed.
exec: Option<String>
The command to execute. This will step as executable.
with: Option<HashMap<String, String>>
The optional step args.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnwindSafe for Step
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
Mutably borrows from an owned value. Read more