pub struct WorkflowMachine<S> {
pub run: WorkflowRun,
/* private fields */
}Expand description
A state machine for managing the lifecycle of a WorkflowRun.
Fields§
§run: WorkflowRunThe underlying workflow run data model.
Implementations§
Source§impl<S> WorkflowMachine<S>
impl<S> WorkflowMachine<S>
Sourcepub fn new_from_run(run: WorkflowRun) -> Self
pub fn new_from_run(run: WorkflowRun) -> Self
New from run.
Sourcepub fn into_run(self) -> WorkflowRun
pub fn into_run(self) -> WorkflowRun
Into run.
Source§impl WorkflowMachine<Queued>
impl WorkflowMachine<Queued>
Sourcepub fn new(run: WorkflowRun) -> Self
pub fn new(run: WorkflowRun) -> Self
New.
Sourcepub async fn start_resolving(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Resolving>>
pub async fn start_resolving( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Resolving>>
Start resolving.
Sourcepub async fn abort(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Aborted>>
pub async fn abort( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Aborted>>
Abort.
Source§impl WorkflowMachine<Resolving>
impl WorkflowMachine<Resolving>
Sourcepub async fn start_pending(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<StartPending>>
pub async fn start_pending( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<StartPending>>
Start pending.
Sourcepub async fn fail(
self,
error: String,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Failed>>
pub async fn fail( self, error: String, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Failed>>
Fail.
Sourcepub async fn abort(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Aborted>>
pub async fn abort( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Aborted>>
Abort.
Source§impl WorkflowMachine<StartPending>
impl WorkflowMachine<StartPending>
Sourcepub async fn start(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Running>>
pub async fn start( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Running>>
Start.
Sourcepub async fn fail(
self,
error: String,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Failed>>
pub async fn fail( self, error: String, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Failed>>
Fail.
Sourcepub async fn abort(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Aborted>>
pub async fn abort( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Aborted>>
Abort.
Source§impl WorkflowMachine<Running>
impl WorkflowMachine<Running>
Sourcepub async fn succeed(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Succeeded>>
pub async fn succeed( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Succeeded>>
Succeed.
Sourcepub async fn fail(
self,
error: String,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Failed>>
pub async fn fail( self, error: String, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Failed>>
Fail.
Sourcepub async fn abort(
self,
executor: &mut PgConnection,
) -> Result<WorkflowMachine<Aborted>>
pub async fn abort( self, executor: &mut PgConnection, ) -> Result<WorkflowMachine<Aborted>>
Abort.
Auto Trait Implementations§
impl<S> Freeze for WorkflowMachine<S>
impl<S> RefUnwindSafe for WorkflowMachine<S>where
S: RefUnwindSafe,
impl<S> Send for WorkflowMachine<S>where
S: Send,
impl<S> Sync for WorkflowMachine<S>where
S: Sync,
impl<S> Unpin for WorkflowMachine<S>where
S: Unpin,
impl<S> UnsafeUnpin for WorkflowMachine<S>
impl<S> UnwindSafe for WorkflowMachine<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.