Skip to main content

TypedWorkflowAdapter

Struct TypedWorkflowAdapter 

Source
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>

Source

pub const fn new(definition: W, executor: E) -> TypedWorkflowAdapter<W, E>

Pairs a definition with its executor.

Source

pub const fn definition(&self) -> &W

The typed definition.

Source

pub const fn executor(&self) -> &E

The typed executor.

Trait Implementations§

Source§

impl<W, E> Debug for TypedWorkflowAdapter<W, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<W, E> ErasedExecutor for TypedWorkflowAdapter<W, E>

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,

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,

Executes an erased batch.
Source§

impl<W, E> ErasedWorkflow for TypedWorkflowAdapter<W, E>
where W: WorkflowDefinition, E: Send + Sync,

Source§

fn key(&self) -> WorkflowKey

Stable key.
Source§

fn version(&self) -> WorkflowVersion

Version.
Source§

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>

The operations offered for this case, validated and stamped with this workflow.
Source§

fn summary(&self) -> Option<String>

One line saying what the workflow is for.
Source§

fn glossary(&self) -> Vec<GlossaryTerm>

Terms this workflow’s users say, and what they mean here.
Source§

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>

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>

What must be true of another case before this workflow may be started. Read more
Source§

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>

What a confirmation the policy engine raises is about. Read more
Source§

fn artifacts( &self, view: &ErasedWorkflowView, ) -> Result<Vec<ArtifactRef>, ErasureError>

The documents the case view describes has. Read more
Source§

fn may_open_beside( &self, open: &[ErasedWorkflowView], ) -> Result<(), ErasedCallError>

Whether a new case may be opened while open ones are. Read more
Source§

fn narration_briefing( &self, stage: WritingStage, view: &ErasedWorkflowView, ) -> Result<Option<String>, ErasureError>

What this workflow wants said in the phase view is in. Read more
Source§

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 more
Source§

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>

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>

Compiles a resolved act into erased commands.
Source§

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>

Policy of an erased command.
Source§

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>

Renders receipts from erased ledger events. Read more
Source§

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>
where W: Freeze, E: Freeze,

§

impl<W, E> RefUnwindSafe for TypedWorkflowAdapter<W, E>

§

impl<W, E> Send for TypedWorkflowAdapter<W, E>
where W: Send, E: Send,

§

impl<W, E> Sync for TypedWorkflowAdapter<W, E>
where W: Sync, E: Sync,

§

impl<W, E> Unpin for TypedWorkflowAdapter<W, E>
where W: Unpin, E: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<E> ErasedCaseLoader for E
where 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,

Loads a case for an account as JSON. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more