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,
) -> Self
pub const fn new( id: StepExecutionId, job_execution_id: JobExecutionId, step_name: StepName, metadata: ExecutionMetadata, ) -> Self
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,
) -> Self
pub const fn from_snapshot( id: StepExecutionId, job_execution_id: JobExecutionId, step_name: StepName, metadata: ExecutionMetadata, version: ExecutionVersion, ) -> Self
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<Self, LifecycleError>
pub fn new_restart_attempt( &self, expected_version: ExecutionVersion, new_execution_id: StepExecutionId, new_job_execution_id: JobExecutionId, created_at: SystemTime, ) -> Result<Self, 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 more