pub struct JobRunner { /* private fields */ }Expand description
Runs a specific Job.
The simplest way to use this is to repeatedly call run_next_step() until
next_step_index() >= step_count().
Implementations§
Source§impl JobRunner
impl JobRunner
Sourcepub fn container_images(&self) -> &[ContainerImage]
pub fn container_images(&self) -> &[ContainerImage]
The job requires a specific set of containers, one container per
entry in the returned list. Each container must use the given
ContainerImage.
Sourcepub fn step_count(&self) -> StepIndex
pub fn step_count(&self) -> StepIndex
The total number of steps in the job.
Sourcepub fn next_step_index(&self) -> StepIndex
pub fn next_step_index(&self) -> StepIndex
The index of the next step to be executed.
Sourcepub fn next_step_name(&self) -> Result<Option<String>, RunnerError>
pub fn next_step_name(&self) -> Result<Option<String>, RunnerError>
The name of the next step to be executed, if there is one.
Sourcepub fn find_step_by_name(
&self,
step_name: &str,
) -> Result<Option<StepIndex>, RunnerError>
pub fn find_step_by_name( &self, step_name: &str, ) -> Result<Option<StepIndex>, RunnerError>
Look up a step by name. We don’t have access to variables set by previous steps so this might not work in obscure cases…
Sourcepub fn peek_step_env(
&self,
step_index: StepIndex,
) -> Result<LinkedHashMap<String, String>, RunnerError>
pub fn peek_step_env( &self, step_index: StepIndex, ) -> Result<LinkedHashMap<String, String>, RunnerError>
Get the environment variables set in a specific step. We don’t have access to variables set by previous steps so this might not work in obscure cases…
Sourcepub async fn run_next_step<B: RunnerBackend, I>(
&mut self,
interpose: I,
backend: &mut B,
) -> Result<i32, RunnerError>
pub async fn run_next_step<B: RunnerBackend, I>( &mut self, interpose: I, backend: &mut B, ) -> Result<i32, RunnerError>
interpose lets you modify the command that will be run for the step.
Auto Trait Implementations§
impl !Freeze for JobRunner
impl !RefUnwindSafe for JobRunner
impl Send for JobRunner
impl Sync for JobRunner
impl Unpin for JobRunner
impl !UnwindSafe for JobRunner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more