#[non_exhaustive]pub struct ExecutionReport {
pub outcomes: Vec<CommandOutcomeRecord>,
pub events: Vec<EventBatch>,
pub committed: Vec<CommittedEvent<Value>>,
pub changed: IndexMap<CaseKey, CaseRevision>,
pub outbox: Vec<OutboxEntry>,
pub completions: Vec<(CommandId, JournalOutcome)>,
pub rejections: Vec<(CaseRef, DomainRejection)>,
}Expand description
What executing one turn’s batches produced.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.outcomes: Vec<CommandOutcomeRecord>One record per envelope, in batch then envelope order.
events: Vec<EventBatch>Event batches to append, one per committed command batch.
committed: Vec<CommittedEvent<Value>>Every committed event, in commit order, for receipts (§17.3).
changed: IndexMap<CaseKey, CaseRevision>Cases whose revision moved, with the revision they moved to.
outbox: Vec<OutboxEntry>Outbox rows for the external effects that were accepted locally (§16.4).
completions: Vec<(CommandId, JournalOutcome)>Journal completions for the commit bundle.
rejections: Vec<(CaseRef, DomainRejection)>Domain rejections this stage decided, with the case each was aimed at. Some can only be decided here, such as a name no registry entry matches; each reaches the writing stage with the domain’s explanation, as a reducer refusal does, so the reply cannot claim it.
Implementations§
Source§impl ExecutionReport
impl ExecutionReport
Sourcepub fn absorb(&mut self, earlier: Self)
pub fn absorb(&mut self, earlier: Self)
Folds an earlier report of the same turn into this one.
A turn that commits twice executed twice, and everything downstream of the commit reads one report: the receipts the writing stage may rest on, the refusals it must not contradict, and whether anything failed. So the halves are joined after the second commit and never before — a bundle built from a joined report would append the first half’s events a second time.
earlier goes first in every list, because commit order is the order
receipts are read in. A case that moved in both halves keeps the later
revision, which is the one it is at.
Sourcepub fn event_ids(&self) -> Vec<EventId>
pub fn event_ids(&self) -> Vec<EventId>
Every event identifier the turn committed, in commit order.
Sourcepub fn all_committed(&self) -> bool
pub fn all_committed(&self) -> bool
Returns true when every command committed.
Sourcepub fn any_committed(&self) -> bool
pub fn any_committed(&self) -> bool
Returns true when at least one command committed.
Sourcepub fn has_unknown_outcome(&self) -> bool
pub fn has_unknown_outcome(&self) -> bool
Returns true when a command ended with an effect that may or may not
have happened, so the turn must say “verification in progress” and a
reconciler must settle it (I15).
Sourcepub fn pending_attempts(&self) -> Vec<AttemptId>
pub fn pending_attempts(&self) -> Vec<AttemptId>
The attempts a reconciler has to settle.
Sourcepub fn failed_outright(&self) -> bool
pub fn failed_outright(&self) -> bool
Returns true when no command committed and at least one failed, which
is what makes a receipt impossible.
Sourcepub fn any_uncommitted(&self) -> bool
pub fn any_uncommitted(&self) -> bool
Returns true when any command did not commit — a rejection, a
conflict, a failure, or an outcome nobody knows yet.
This, rather than Self::failed_outright, is what makes a notice
mandatory: a turn where two commands committed and a third did not is
still a turn that has to say so, and receipts alone would let the user
read the silence as success.
Sourcepub fn bundle(&self) -> CommitBundle
pub fn bundle(&self) -> CommitBundle
The bundle items this execution produced: journal completions, events and outbox rows.
The caller adds the card resolutions, the new cards, the replay record and the phase marker, then writes everything at once (§16.3).