[][src]Struct workflow::Step

pub struct Step {
    pub name: Option<String>,
    pub uses: Option<String>,
    pub exec: Option<String>,
    pub with: Option<HashMap<String, String>>,
}

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

impl Step[src]

pub fn executable(&self) -> bool[src]

executable determines if the step is an executable one

Trait Implementations

impl Debug for Step[src]

impl Default for Step[src]

impl<'de> Deserialize<'de> for Step[src]

impl Serialize for Step[src]

Auto Trait Implementations

impl RefUnwindSafe for Step

impl Send for Step

impl Sync for Step

impl Unpin for Step

impl UnwindSafe for Step

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.