Skip to main content

ExecutionReport

Struct ExecutionReport 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Source

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.

Source

pub fn event_ids(&self) -> Vec<EventId>

Every event identifier the turn committed, in commit order.

Source

pub fn all_committed(&self) -> bool

Returns true when every command committed.

Source

pub fn any_committed(&self) -> bool

Returns true when at least one command committed.

Source

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).

Source

pub fn pending_attempts(&self) -> Vec<AttemptId>

The attempts a reconciler has to settle.

Source

pub fn failed_outright(&self) -> bool

Returns true when no command committed and at least one failed, which is what makes a receipt impossible.

Source

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.

Source

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).

Trait Implementations§

Source§

impl Clone for ExecutionReport

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecutionReport

Source§

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

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

impl Default for ExecutionReport

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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