ApplyOutcome<R> class sealed

The official, auditable result of submitting an ApplyCommand.

Every time you ask a cell to perform an action (by submitting a command), the framework returns an ApplyOutcome. This acts as a Forensic Receipt, telling you exactly what happened to your request.

Because this is a sealed class, the result will always be one of three specific types:

  • ApplyAccepted — The command was successful and returned a result.
  • ApplyRejected — The safety rules (Integrity Gate) denied the request.
  • ApplyStaged — The command is waiting to run inside a transaction.

Why it is used

  • Causal Tracking: It ensures that every action in the system has a matching record, making it easy to trace the history of any state change.
  • Type Safety: By using a sealed class, the compiler forces you to handle all possible results (success, failure, or staged), preventing unhandled errors in your logic.
  • Transaction Support: It allows the framework to signal that a change hasn't happened yet but is safely queued in the ledger.

How it works

When you call Cell.apply, the framework processes the command and packages the result into this object. Along with the result, it attaches an ApplyReceipt, which contains "meta" information like a unique ID, the exact time of the change, and the specific cell that was involved.

Technical Details

  • Generic Result R: The outcome preserves the type of the value returned by the function, so you maintain full type-safety for the resulting data.
  • Immutable: Outcomes are read-only records of what occurred; they cannot be changed after they are created.

See also:

  • ApplyReceipt — The detailed "receipt" attached to every outcome.
  • Cell.apply — The method that produces these outcomes.
  • ApplyCommand — The request that generated this outcome.

Properties

hashCode → int
The hash code for this object.
no setterinherited
receipt → ApplyReceipt
The forensic receipt of this submission.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited