pub struct TypedWorkflowAdapter<W, E> { /* private fields */ }Expand description
Wraps a typed definition and executor, converting only at the boundary.
Implementations§
Source§impl<W, E> TypedWorkflowAdapter<W, E>
impl<W, E> TypedWorkflowAdapter<W, E>
Sourcepub const fn new(definition: W, executor: E) -> TypedWorkflowAdapter<W, E>
pub const fn new(definition: W, executor: E) -> TypedWorkflowAdapter<W, E>
Pairs a definition with its executor.
Sourcepub const fn definition(&self) -> &W
pub const fn definition(&self) -> &W
The typed definition.
Trait Implementations§
Source§impl<W, E> Debug for TypedWorkflowAdapter<W, E>where
W: WorkflowDefinition,
impl<W, E> Debug for TypedWorkflowAdapter<W, E>where
W: WorkflowDefinition,
Source§impl<W, E> ErasedExecutor for TypedWorkflowAdapter<W, E>where
W: WorkflowDefinition,
E: WorkflowExecutor<W>,
impl<W, E> ErasedExecutor for TypedWorkflowAdapter<W, E>where
W: WorkflowDefinition,
E: WorkflowExecutor<W>,
Source§fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
case_id: &'life2 CaseId,
) -> Pin<Box<dyn Future<Output = Result<Versioned<Option<Value>>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TypedWorkflowAdapter<W, E>: 'async_trait,
fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
case_id: &'life2 CaseId,
) -> Pin<Box<dyn Future<Output = Result<Versioned<Option<Value>>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TypedWorkflowAdapter<W, E>: 'async_trait,
Loads a case for an account as JSON.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
batch: CommandBatch<Value>,
) -> Pin<Box<dyn Future<Output = Result<Commit<Value, Value>, ExecutionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
TypedWorkflowAdapter<W, E>: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
batch: CommandBatch<Value>,
) -> Pin<Box<dyn Future<Output = Result<Commit<Value, Value>, ExecutionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
TypedWorkflowAdapter<W, E>: 'async_trait,
Executes an erased batch.
Source§impl<W, E> ErasedWorkflow for TypedWorkflowAdapter<W, E>
impl<W, E> ErasedWorkflow for TypedWorkflowAdapter<W, E>
Source§fn key(&self) -> WorkflowKey
fn key(&self) -> WorkflowKey
Stable key.
Source§fn version(&self) -> WorkflowVersion
fn version(&self) -> WorkflowVersion
Version.
Source§fn project(
&self,
case_ref: CaseRef,
state: Option<&Value>,
) -> Result<ErasedWorkflowView, ErasureError>
fn project( &self, case_ref: CaseRef, state: Option<&Value>, ) -> Result<ErasedWorkflowView, ErasureError>
Projects a case.
Source§fn operations(
&self,
case_ref: CaseRef,
state: Option<&Value>,
) -> Result<Vec<OperationSpec>, ErasureError>
fn operations( &self, case_ref: CaseRef, state: Option<&Value>, ) -> Result<Vec<OperationSpec>, ErasureError>
The operations offered for this case, validated and stamped with this workflow.
Source§fn glossary(&self) -> Vec<GlossaryTerm>
fn glossary(&self) -> Vec<GlossaryTerm>
Terms this workflow’s users say, and what they mean here.
Source§fn noun(&self) -> Option<LocalizedText>
fn noun(&self) -> Option<LocalizedText>
What one record of this workflow is called. See
WorkflowDefinition::noun.Source§fn briefing(
&self,
case_ref: CaseRef,
state: Option<&Value>,
) -> Result<Option<String>, ErasureError>
fn briefing( &self, case_ref: CaseRef, state: Option<&Value>, ) -> Result<Option<String>, ErasureError>
Guidance for understanding a turn about this case, as the workflow wrote it,
untruncated: the deployment’s
BriefingBudget
applies where it is shown.Source§fn start_preconditions(&self) -> Vec<StartPrecondition>
fn start_preconditions(&self) -> Vec<StartPrecondition>
What must be true of another case before this workflow may be started. Read more
Source§fn start_behaviour(&self) -> StartBehaviour
fn start_behaviour(&self) -> StartBehaviour
What starting this workflow means when a case of it is already open. Read more
Source§fn confirmation_subject(
&self,
case_ref: CaseRef,
state: Option<&Value>,
act: &ResolvedAct,
) -> Result<Option<ConfirmationSubject>, ErasureError>
fn confirmation_subject( &self, case_ref: CaseRef, state: Option<&Value>, act: &ResolvedAct, ) -> Result<Option<ConfirmationSubject>, ErasureError>
What a confirmation the policy engine raises is about. Read more
Source§fn artifacts(
&self,
view: &ErasedWorkflowView,
) -> Result<Vec<ArtifactRef>, ErasureError>
fn artifacts( &self, view: &ErasedWorkflowView, ) -> Result<Vec<ArtifactRef>, ErasureError>
The documents the case
view describes has. Read moreSource§fn may_open_beside(
&self,
open: &[ErasedWorkflowView],
) -> Result<(), ErasedCallError>
fn may_open_beside( &self, open: &[ErasedWorkflowView], ) -> Result<(), ErasedCallError>
Whether a new case may be opened while
open ones are. Read moreSource§fn narration_briefing(
&self,
stage: WritingStage,
view: &ErasedWorkflowView,
) -> Result<Option<String>, ErasureError>
fn narration_briefing( &self, stage: WritingStage, view: &ErasedWorkflowView, ) -> Result<Option<String>, ErasureError>
What this workflow wants said in the phase
view is in. Read moreSource§fn enumerations(
&self,
case_ref: CaseRef,
state: Option<&Value>,
) -> Result<Vec<DomainEnumeration>, ErasureError>
fn enumerations( &self, case_ref: CaseRef, state: Option<&Value>, ) -> Result<Vec<DomainEnumeration>, ErasureError>
The complete value sets this workflow accepts, for the case in
state. Read moreSource§fn next_steps(
&self,
view: &ErasedWorkflowView,
) -> Result<Vec<LocalizedText>, ErasureError>
fn next_steps( &self, view: &ErasedWorkflowView, ) -> Result<Vec<LocalizedText>, ErasureError>
What the user may do next once the case owes nothing, erased. See
WorkflowDefinition::next_steps.Source§fn obligation_sentence(
&self,
obligation: &Value,
) -> Result<Option<LocalizedText>, ErasureError>
fn obligation_sentence( &self, obligation: &Value, ) -> Result<Option<LocalizedText>, ErasureError>
One obligation in words, erased. See
WorkflowDefinition::obligation_sentence.Source§fn compile_act(
&self,
case_ref: CaseRef,
state: Option<&Value>,
act: &ResolvedAct,
) -> Result<Vec<Value>, ErasedCallError>
fn compile_act( &self, case_ref: CaseRef, state: Option<&Value>, act: &ResolvedAct, ) -> Result<Vec<Value>, ErasedCallError>
Compiles a resolved act into erased commands.
Source§fn nothing_changed(
&self,
state: Option<&Value>,
act: &ResolvedAct,
) -> Option<LocalizedText>
fn nothing_changed( &self, state: Option<&Value>, act: &ResolvedAct, ) -> Option<LocalizedText>
Why an act that compiled nothing changed nothing. Read more
Source§fn command_policy(
&self,
state: Option<&Value>,
command: &Value,
) -> Result<CommandPolicy, ErasureError>
fn command_policy( &self, state: Option<&Value>, command: &Value, ) -> Result<CommandPolicy, ErasureError>
Policy of an erased command.
Source§fn validate_command(
&self,
state: Option<&Value>,
command: &Value,
) -> Result<(), ErasedCallError>
fn validate_command( &self, state: Option<&Value>, command: &Value, ) -> Result<(), ErasedCallError>
Validates an erased command.
Source§fn receipts(
&self,
events: &[ReceiptEvent<Value>],
locale: &Locale,
) -> Result<Vec<OperationalReceipt>, ErasureError>
fn receipts( &self, events: &[ReceiptEvent<Value>], locale: &Locale, ) -> Result<Vec<OperationalReceipt>, ErasureError>
Renders receipts from erased ledger events. Read more
Source§fn build_interaction(
&self,
case_ref: CaseRef,
state: Option<&Value>,
requirement: &InteractionRequirement,
) -> Result<InteractionSpec, ErasedCallError>
fn build_interaction( &self, case_ref: CaseRef, state: Option<&Value>, requirement: &InteractionRequirement, ) -> Result<InteractionSpec, ErasedCallError>
Builds the interaction spec for a requirement of the projected view. Read more
Auto Trait Implementations§
impl<W, E> Freeze for TypedWorkflowAdapter<W, E>
impl<W, E> RefUnwindSafe for TypedWorkflowAdapter<W, E>where
W: RefUnwindSafe,
E: RefUnwindSafe,
impl<W, E> Send for TypedWorkflowAdapter<W, E>
impl<W, E> Sync for TypedWorkflowAdapter<W, E>
impl<W, E> Unpin for TypedWorkflowAdapter<W, E>
impl<W, E> UnsafeUnpin for TypedWorkflowAdapter<W, E>where
W: UnsafeUnpin,
E: UnsafeUnpin,
impl<W, E> UnwindSafe for TypedWorkflowAdapter<W, E>where
W: UnwindSafe,
E: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<E> ErasedCaseLoader for Ewhere
E: ErasedExecutor + ?Sized,
impl<E> ErasedCaseLoader for Ewhere
E: ErasedExecutor + ?Sized,
Source§fn load_case<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
case_id: &'life2 CaseId,
) -> Pin<Box<dyn Future<Output = Result<Versioned<Option<Value>>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
E: 'async_trait,
fn load_case<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
case_id: &'life2 CaseId,
) -> Pin<Box<dyn Future<Output = Result<Versioned<Option<Value>>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
E: 'async_trait,
Loads a case for an account as JSON. Read more