pub struct Commit<S, E> {
pub state: Option<S>,
pub new_revision: CaseRevision,
pub events: Vec<CommittedEvent<E>>,
pub idempotency_replay: bool,
}Expand description
Result of executing a command batch (spec §17.1).
Fields§
§state: Option<S>State after the commit, or None when the case no longer exists.
None is written as a missing key, so a State type that itself
serializes to JSON null ((), an empty newtype, an Option field at
the root) reads back as “the case is gone”. A workflow state must
therefore serialize to an object; the same rule holds for
WorkflowDefinition::Outcome,
whose erased form drives
ErasedWorkflowView::is_complete.
Concrete serde_json::Value fields that must keep an explicit null
use FieldValue instead.
new_revision: CaseRevisionRevision after the commit.
events: Vec<CommittedEvent<E>>Events committed by this batch.
idempotency_replay: booltrue when the executor recognised the idempotency key and returned the
original outcome without repeating the effect (I14).
Implementations§
Source§impl<S, E: Clone> Commit<S, E>
impl<S, E: Clone> Commit<S, E>
Sourcepub fn receipt_events(&self) -> Vec<ReceiptEvent<E>>
pub fn receipt_events(&self) -> Vec<ReceiptEvent<E>>
The commit’s events in the form
WorkflowDefinition::receipts
takes.
Every event of a fresh commit still has its payload, so this is the
whole conversion: a ReceiptEvent::Redacted only ever comes back out
of the store, never out of an execution.
Trait Implementations§
Source§impl<'de, S, E> Deserialize<'de> for Commit<S, E>
impl<'de, S, E> Deserialize<'de> for Commit<S, E>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<S: Eq, E: Eq> Eq for Commit<S, E>
impl<S: PartialEq, E: PartialEq> StructuralPartialEq for Commit<S, E>
Auto Trait Implementations§
impl<S, E> Freeze for Commit<S, E>
impl<S, E> RefUnwindSafe for Commit<S, E>
impl<S, E> Send for Commit<S, E>
impl<S, E> Sync for Commit<S, E>
impl<S, E> Unpin for Commit<S, E>
impl<S, E> UnsafeUnpin for Commit<S, E>
impl<S, E> UnwindSafe for Commit<S, E>
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.