pub struct StepExecution { /* private fields */ }Expand description
One attempt to execute a named step within a job execution.
Implementations§
Source§impl StepExecution
impl StepExecution
Sourcepub const fn new(
id: StepExecutionId,
job_execution_id: JobExecutionId,
step_name: StepName,
metadata: ExecutionMetadata,
) -> StepExecution
pub const fn new( id: StepExecutionId, job_execution_id: JobExecutionId, step_name: StepName, metadata: ExecutionMetadata, ) -> StepExecution
Constructs a step execution record from validated metadata.
Sourcepub const fn from_snapshot(
id: StepExecutionId,
job_execution_id: JobExecutionId,
step_name: StepName,
metadata: ExecutionMetadata,
version: ExecutionVersion,
) -> StepExecution
pub const fn from_snapshot( id: StepExecutionId, job_execution_id: JobExecutionId, step_name: StepName, metadata: ExecutionMetadata, version: ExecutionVersion, ) -> StepExecution
Reconstructs a step execution snapshot with its optimistic version.
Sourcepub const fn id(&self) -> StepExecutionId
pub const fn id(&self) -> StepExecutionId
Returns the step-attempt identifier.
Sourcepub const fn job_execution_id(&self) -> JobExecutionId
pub const fn job_execution_id(&self) -> JobExecutionId
Returns the enclosing job-execution identifier.
Sourcepub const fn metadata(&self) -> &ExecutionMetadata
pub const fn metadata(&self) -> &ExecutionMetadata
Borrows the execution metadata.
Sourcepub const fn version(&self) -> ExecutionVersion
pub const fn version(&self) -> ExecutionVersion
Returns the facade-owned optimistic-lock version.
Sourcepub fn transition(
&mut self,
expected_version: ExecutionVersion,
transition: LifecycleTransition,
) -> Result<ExecutionVersion, LifecycleError>
pub fn transition( &mut self, expected_version: ExecutionVersion, transition: LifecycleTransition, ) -> Result<ExecutionVersion, LifecycleError>
Applies one legal lifecycle transition using compare-and-swap semantics.
§Errors
Returns a typed lifecycle/conflict error without mutating this snapshot.
Sourcepub fn enrich_exit_status(
&mut self,
expected_version: ExecutionVersion,
exit_status: ExitStatus,
) -> Result<ExecutionVersion, LifecycleError>
pub fn enrich_exit_status( &mut self, expected_version: ExecutionVersion, exit_status: ExitStatus, ) -> Result<ExecutionVersion, LifecycleError>
Enriches flow/operator exit status without changing batch status.
§Errors
Returns a typed conflict/version error without mutating this snapshot.
Sourcepub fn new_restart_attempt(
&self,
expected_version: ExecutionVersion,
new_execution_id: StepExecutionId,
new_job_execution_id: JobExecutionId,
created_at: SystemTime,
) -> Result<StepExecution, LifecycleError>
pub fn new_restart_attempt( &self, expected_version: ExecutionVersion, new_execution_id: StepExecutionId, new_job_execution_id: JobExecutionId, created_at: SystemTime, ) -> Result<StepExecution, LifecycleError>
Creates a fresh STARTING step attempt under a new job execution.
The prior step execution remains unchanged.
§Errors
Returns a typed stale-version, non-restartable, or reused-ID error.
Trait Implementations§
Source§impl Clone for StepExecution
impl Clone for StepExecution
Source§fn clone(&self) -> StepExecution
fn clone(&self) -> StepExecution
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 StepExecution
impl Debug for StepExecution
impl Eq for StepExecution
Source§impl PartialEq for StepExecution
impl PartialEq for StepExecution
impl StructuralPartialEq for StepExecution
Auto Trait Implementations§
impl Freeze for StepExecution
impl RefUnwindSafe for StepExecution
impl Send for StepExecution
impl Sync for StepExecution
impl Unpin for StepExecution
impl UnsafeUnpin for StepExecution
impl UnwindSafe for StepExecution
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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