pub struct WorkflowDefinitionBuilder { /* private fields */ }Expand description
Builder for creating workflow definitions
Implementations§
Source§impl WorkflowDefinitionBuilder
impl WorkflowDefinitionBuilder
Sourcepub fn new(id: String, name: String, version: Version) -> Self
pub fn new(id: String, name: String, version: Version) -> Self
Create a new workflow definition builder
Sourcepub fn description(self, desc: String) -> Self
pub fn description(self, desc: String) -> Self
Set the description
Sourcepub fn add_stage(self, stage: WorkflowStage) -> Self
pub fn add_stage(self, stage: WorkflowStage) -> Self
Add a stage to the workflow
Sourcepub fn add_transition(
self,
from_stage: StageId,
event: WorkflowEvent,
to_stage: StageId,
) -> Self
pub fn add_transition( self, from_stage: StageId, event: WorkflowEvent, to_stage: StageId, ) -> Self
Add a transition rule
Sourcepub fn set_stage_timeout(self, stage: StageId, timeout: Duration) -> Self
pub fn set_stage_timeout(self, stage: StageId, timeout: Duration) -> Self
Set timeout for a stage
Sourcepub fn set_error_handler(self, stage: StageId, handler: ErrorHandler) -> Self
pub fn set_error_handler(self, stage: StageId, handler: ErrorHandler) -> Self
Set error handler for a stage
Sourcepub fn initial_stage(self, stage: StageId) -> Self
pub fn initial_stage(self, stage: StageId) -> Self
Set the initial stage
Sourcepub fn add_final_stage(self, stage: StageId) -> Self
pub fn add_final_stage(self, stage: StageId) -> Self
Add a final stage
Sourcepub fn global_timeout(self, timeout: Duration) -> Self
pub fn global_timeout(self, timeout: Duration) -> Self
Set global timeout
Sourcepub fn add_metadata(self, key: String, value: String) -> Self
pub fn add_metadata(self, key: String, value: String) -> Self
Add metadata
Sourcepub fn build(self) -> WorkflowDefinition
pub fn build(self) -> WorkflowDefinition
Build the workflow definition
Auto Trait Implementations§
impl Freeze for WorkflowDefinitionBuilder
impl !RefUnwindSafe for WorkflowDefinitionBuilder
impl Send for WorkflowDefinitionBuilder
impl Sync for WorkflowDefinitionBuilder
impl Unpin for WorkflowDefinitionBuilder
impl !UnwindSafe for WorkflowDefinitionBuilder
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