pub struct WorkflowView<P, O, T> {
pub case_ref: CaseRef,
pub workflow_version: WorkflowVersion,
pub phase: P,
pub obligations: Vec<O>,
pub blocking_interaction: Option<InteractionRequirement>,
pub notices: Vec<WorkflowNotice>,
pub outcome: Option<T>,
}Expand description
The pure projection of a case (spec §8.1).
Fields§
§case_ref: CaseRefThe case and the revision it was projected at.
workflow_version: WorkflowVersionVersion of the definition that produced the view.
phase: PExactly one lifecycle phase (I3).
obligations: Vec<O>Every currently open obligation, possibly parameterized (I4), in the order the workflow wants them asked for.
A set is the truth about what is open and is what an index wants; it cannot say which one is being asked. Told to pick “the most useful one” a writer picks, and a collection flow was asked for its bank account first and its beneficiary second — the last question of the flow — and then read all six out as a menu. So the list is ordered by declaration and the writer is told to ask for the first.
Ordering rather than a single “current” obligation, because some domains genuinely have several open at once — a proposal reviewed in one answer, three extras with no payer that one message can close two of — and a shape that forced exactly one would make those unsayable.
blocking_interaction: Option<InteractionRequirement>Zero or one blocking interaction requirement (I5, I6).
notices: Vec<WorkflowNotice>Informational, non-blocking elements.
outcome: Option<T>Present only when the workflow is complete.
Implementations§
Source§impl<P, O, T> WorkflowView<P, O, T>
impl<P, O, T> WorkflowView<P, O, T>
Sourcepub fn new(
case_ref: CaseRef,
workflow_version: WorkflowVersion,
phase: P,
) -> WorkflowView<P, O, T>
pub fn new( case_ref: CaseRef, workflow_version: WorkflowVersion, phase: P, ) -> WorkflowView<P, O, T>
A view with a phase and nothing else.
Sourcepub fn with_obligations(
self,
obligations: impl IntoIterator<Item = O>,
) -> WorkflowView<P, O, T>
pub fn with_obligations( self, obligations: impl IntoIterator<Item = O>, ) -> WorkflowView<P, O, T>
Adds obligations.
Sourcepub fn with_blocking_interaction(
self,
requirement: InteractionRequirement,
) -> WorkflowView<P, O, T>
pub fn with_blocking_interaction( self, requirement: InteractionRequirement, ) -> WorkflowView<P, O, T>
Sets the blocking requirement.
Sourcepub fn with_notice(self, notice: WorkflowNotice) -> WorkflowView<P, O, T>
pub fn with_notice(self, notice: WorkflowNotice) -> WorkflowView<P, O, T>
Adds a notice.
Sourcepub fn with_outcome(self, outcome: T) -> WorkflowView<P, O, T>
pub fn with_outcome(self, outcome: T) -> WorkflowView<P, O, T>
Sets the outcome.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true when an outcome is present.
Sourcepub fn has_obligations(&self) -> bool
pub fn has_obligations(&self) -> bool
Returns true when obligations remain.
Source§impl<P, O, T> WorkflowView<P, O, T>
impl<P, O, T> WorkflowView<P, O, T>
Sourcepub fn erase(
&self,
ownership: PhaseOwnership,
) -> Result<ErasedWorkflowView, HashError>
pub fn erase( &self, ownership: PhaseOwnership, ) -> Result<ErasedWorkflowView, HashError>
Erases the generics into canonical JSON, attaching the phase ownership the definition declares.
Trait Implementations§
Source§impl<P, O, T> Clone for WorkflowView<P, O, T>
impl<P, O, T> Clone for WorkflowView<P, O, T>
Source§fn clone(&self) -> WorkflowView<P, O, T>
fn clone(&self) -> WorkflowView<P, O, T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<P, O, T> Debug for WorkflowView<P, O, T>
impl<P, O, T> Debug for WorkflowView<P, O, T>
Source§impl<'de, P, O, T> Deserialize<'de> for WorkflowView<P, O, T>
impl<'de, P, O, T> Deserialize<'de> for WorkflowView<P, O, T>
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WorkflowView<P, O, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WorkflowView<P, O, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl<P, O, T> Eq for WorkflowView<P, O, T>
Source§impl<P, O, T> PartialEq for WorkflowView<P, O, T>
impl<P, O, T> PartialEq for WorkflowView<P, O, T>
Source§impl<P, O, T> Serialize for WorkflowView<P, O, T>
impl<P, O, T> Serialize for WorkflowView<P, O, T>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<P, O, T> StructuralPartialEq for WorkflowView<P, O, T>
Auto Trait Implementations§
impl<P, O, T> Freeze for WorkflowView<P, O, T>
impl<P, O, T> RefUnwindSafe for WorkflowView<P, O, T>
impl<P, O, T> Send for WorkflowView<P, O, T>
impl<P, O, T> Sync for WorkflowView<P, O, T>
impl<P, O, T> Unpin for WorkflowView<P, O, T>
impl<P, O, T> UnsafeUnpin for WorkflowView<P, O, T>
impl<P, O, T> UnwindSafe for WorkflowView<P, O, T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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 more