pub struct StepMachine<S> {
pub instance: StepInstance,
/* private fields */
}Expand description
A state machine for managing the lifecycle of a StepInstance.
Fields§
§instance: StepInstanceThe underlying step instance data model.
Implementations§
Source§impl<S> StepMachine<S>
impl<S> StepMachine<S>
Sourcepub fn from_instance(instance: StepInstance) -> Self
pub fn from_instance(instance: StepInstance) -> Self
From instance.
Source§impl StepMachine<Pending>
impl StepMachine<Pending>
Sourcepub fn new(instance: StepInstance) -> Self
pub fn new(instance: StepInstance) -> Self
New.
Sourcepub async fn start(
self,
runner_id: String,
executor: &mut PgConnection,
) -> Result<StepMachine<Running>>
pub async fn start( self, runner_id: String, executor: &mut PgConnection, ) -> Result<StepMachine<Running>>
Start.
Sourcepub async fn start_unpacking(
self,
runner_id: String,
executor: &mut PgConnection,
) -> Result<StepMachine<UnpackingSfs>>
pub async fn start_unpacking( self, runner_id: String, executor: &mut PgConnection, ) -> Result<StepMachine<UnpackingSfs>>
Start unpacking.
Sourcepub async fn fail(
self,
error: String,
exit_code: Option<i32>,
executor: &mut PgConnection,
) -> Result<StepMachine<Failed>>
pub async fn fail( self, error: String, exit_code: Option<i32>, executor: &mut PgConnection, ) -> Result<StepMachine<Failed>>
Fail.
Source§impl StepMachine<UnpackingSfs>
impl StepMachine<UnpackingSfs>
Sourcepub async fn start_running(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Running>>
pub async fn start_running( self, executor: &mut PgConnection, ) -> Result<StepMachine<Running>>
Start running.
Sourcepub async fn fail(
self,
error: String,
exit_code: Option<i32>,
executor: &mut PgConnection,
) -> Result<StepMachine<Failed>>
pub async fn fail( self, error: String, exit_code: Option<i32>, executor: &mut PgConnection, ) -> Result<StepMachine<Failed>>
Fail.
Sourcepub async fn skip(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Skipped>>
pub async fn skip( self, executor: &mut PgConnection, ) -> Result<StepMachine<Skipped>>
Skip.
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<Running>
impl StepMachine<Running>
Sourcepub async fn start_packing(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<PackingSfs>>
pub async fn start_packing( self, executor: &mut PgConnection, ) -> Result<StepMachine<PackingSfs>>
Start packing.
Sourcepub async fn succeed(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Succeeded>>
pub async fn succeed( self, executor: &mut PgConnection, ) -> Result<StepMachine<Succeeded>>
Succeed.
Sourcepub async fn fail(
self,
error: String,
exit_code: Option<i32>,
executor: &mut PgConnection,
) -> Result<StepMachine<Failed>>
pub async fn fail( self, error: String, exit_code: Option<i32>, executor: &mut PgConnection, ) -> Result<StepMachine<Failed>>
Fail.
Sourcepub async fn wait_for_event(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<WaitingForEvent>>
pub async fn wait_for_event( self, executor: &mut PgConnection, ) -> Result<StepMachine<WaitingForEvent>>
Wait for event.
Sourcepub async fn abort(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Aborted>>
pub async fn abort( self, executor: &mut PgConnection, ) -> Result<StepMachine<Aborted>>
Abort.
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<PackingSfs>
impl StepMachine<PackingSfs>
Sourcepub async fn succeed(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Succeeded>>
pub async fn succeed( self, executor: &mut PgConnection, ) -> Result<StepMachine<Succeeded>>
Succeed.
Sourcepub async fn fail(
self,
error: String,
exit_code: Option<i32>,
executor: &mut PgConnection,
) -> Result<StepMachine<Failed>>
pub async fn fail( self, error: String, exit_code: Option<i32>, executor: &mut PgConnection, ) -> Result<StepMachine<Failed>>
Fail.
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<WaitingForEvent>
impl StepMachine<WaitingForEvent>
Sourcepub async fn resume(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Running>>
pub async fn resume( self, executor: &mut PgConnection, ) -> Result<StepMachine<Running>>
Resume.
Sourcepub async fn reschedule(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<Pending>>
pub async fn reschedule( self, executor: &mut PgConnection, ) -> Result<StepMachine<Pending>>
Reschedule.
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Sourcepub async fn fail(
self,
error: String,
exit_code: Option<i32>,
executor: &mut PgConnection,
) -> Result<StepMachine<Failed>>
pub async fn fail( self, error: String, exit_code: Option<i32>, executor: &mut PgConnection, ) -> Result<StepMachine<Failed>>
Fail.
Source§impl StepMachine<Failed>
impl StepMachine<Failed>
Sourcepub async fn ignore_failure(
self,
executor: &mut PgConnection,
) -> Result<StepMachine<FailedIgnored>>
pub async fn ignore_failure( self, executor: &mut PgConnection, ) -> Result<StepMachine<FailedIgnored>>
Ignore failure.
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<Succeeded>
impl StepMachine<Succeeded>
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<Skipped>
impl StepMachine<Skipped>
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<FailedIgnored>
impl StepMachine<FailedIgnored>
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Source§impl StepMachine<Aborted>
impl StepMachine<Aborted>
Sourcepub fn into_instance(self) -> StepInstance
pub fn into_instance(self) -> StepInstance
Into instance.
Auto Trait Implementations§
impl<S> Freeze for StepMachine<S>
impl<S> RefUnwindSafe for StepMachine<S>where
S: RefUnwindSafe,
impl<S> Send for StepMachine<S>where
S: Send,
impl<S> Sync for StepMachine<S>where
S: Sync,
impl<S> Unpin for StepMachine<S>where
S: Unpin,
impl<S> UnsafeUnpin for StepMachine<S>
impl<S> UnwindSafe for StepMachine<S>where
S: UnwindSafe,
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.