Struct Job

Source
pub struct Job {
Show 18 fields pub cond: Option<Expression>, pub name: Option<String>, pub runs_on: Option<RunsOn>, pub permissions: Option<Permissions>, pub env: Option<Env>, pub strategy: Option<Strategy>, pub steps: Option<Vec<StepValue>>, pub uses: Option<String>, pub container: Option<Container>, pub outputs: Option<IndexMap<String, String>>, pub concurrency: Option<Concurrency>, pub timeout_minutes: Option<u32>, pub services: Option<IndexMap<String, Container>>, pub secrets: Option<IndexMap<String, Secret>>, pub defaults: Option<Defaults>, pub continue_on_error: Option<bool>, pub retry: Option<RetryStrategy>, pub artifacts: Option<Artifacts>, /* private fields */
}
Expand description

Represents a job in the workflow.

Fields§

§cond: Option<Expression>§name: Option<String>§runs_on: Option<RunsOn>§permissions: Option<Permissions>§env: Option<Env>§strategy: Option<Strategy>§steps: Option<Vec<StepValue>>§uses: Option<String>§container: Option<Container>§outputs: Option<IndexMap<String, String>>§concurrency: Option<Concurrency>§timeout_minutes: Option<u32>§services: Option<IndexMap<String, Container>>§secrets: Option<IndexMap<String, Secret>>§defaults: Option<Defaults>§continue_on_error: Option<bool>§retry: Option<RetryStrategy>§artifacts: Option<Artifacts>

Implementations§

Source§

impl Job

Source

pub fn tmp_needs(self, value: impl Into<Vec<Job>>) -> Job

Source

pub fn cond(self, value: impl Into<Expression>) -> Job

Sets the cond field of this struct.

Source

pub fn name(self, value: impl Into<String>) -> Job

Sets the name field of this struct.

Source

pub fn runs_on(self, value: impl Into<RunsOn>) -> Job

Sets the runs_on field of this struct.

Source

pub fn permissions(self, value: impl Into<Permissions>) -> Job

Sets the permissions field of this struct.

Source

pub fn env(self, value: impl Into<Env>) -> Job

Sets the env field of this struct.

Source

pub fn strategy(self, value: impl Into<Strategy>) -> Job

Sets the strategy field of this struct.

Source

pub fn steps(self, value: impl Into<Vec<StepValue>>) -> Job

Sets the steps field of this struct.

Source

pub fn uses(self, value: impl Into<String>) -> Job

Sets the uses field of this struct.

Source

pub fn container(self, value: impl Into<Container>) -> Job

Sets the container field of this struct.

Source

pub fn outputs(self, value: impl Into<IndexMap<String, String>>) -> Job

Sets the outputs field of this struct.

Source

pub fn concurrency(self, value: impl Into<Concurrency>) -> Job

Sets the concurrency field of this struct.

Source

pub fn timeout_minutes(self, value: impl Into<u32>) -> Job

Sets the timeout_minutes field of this struct.

Source

pub fn services(self, value: impl Into<IndexMap<String, Container>>) -> Job

Sets the services field of this struct.

Source

pub fn secrets(self, value: impl Into<IndexMap<String, Secret>>) -> Job

Sets the secrets field of this struct.

Source

pub fn defaults(self, value: impl Into<Defaults>) -> Job

Sets the defaults field of this struct.

Source

pub fn continue_on_error(self, value: impl Into<bool>) -> Job

Sets the continue_on_error field of this struct.

Source

pub fn retry(self, value: impl Into<RetryStrategy>) -> Job

Sets the retry field of this struct.

Source

pub fn artifacts(self, value: impl Into<Artifacts>) -> Job

Sets the artifacts field of this struct.

Source§

impl Job

Source

pub fn new<T>(name: T) -> Job
where T: ToString,

Creates a new Job with the specified name and default settings.

Source

pub fn add_step_when<S, T>(self, cond: bool, step: S) -> Job
where S: Into<Step<T>>, T: StepType,

Adds a step to the job when a condition is met.

Source

pub fn add_step<S, T>(self, step: S) -> Job
where S: Into<Step<T>>, T: StepType,

Adds a step to the job.

Source

pub fn add_env<T>(self, new_env: T) -> Job
where T: Into<Env>,

Adds an environment variable to the job.

Source

pub fn add_env_when<T>(self, cond: bool, new_env: T) -> Job
where T: Into<Env>,

Adds an environment variable to the job when a condition is met.

Source

pub fn add_steps<T, I>(self, steps: I) -> Job
where T: StepType, I: IntoIterator<Item = Step<T>>,

Add multiple steps to the job at once.

This is a convenience method that takes a vector of steps and adds them all to the job in order.

Source

pub fn add_needs<J>(self, needs: J) -> Job
where J: Into<Job>,

Source

pub fn add_needs_when<T>(self, cond: bool, needs: T) -> Job
where T: Into<Job>,

Adds a dependency to the job when a condition is met.

Trait Implementations§

Source§

impl Clone for Job

Source§

fn clone(&self) -> Job

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Job

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Job

Source§

fn default() -> Job

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Job

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Job, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Job

Source§

fn eq(&self, other: &Job) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Job

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Job

Source§

impl StructuralPartialEq for Job

Auto Trait Implementations§

§

impl Freeze for Job

§

impl RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl UnwindSafe for Job

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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