pub struct Outcome {
pub disposition: Disposition,
pub validity: Validity,
pub reason: Option<String>,
pub payload: Option<Arc<dyn Payload>>,
}Expand description
SRD-82 Part 1 — the two-axis result of any execution shell, and the
effect of an SRD-83 stop condition. The four meaningful
quadrants: Completed+Succeeded (clean), Completed+Failed (ran
fully, garbage), Interrupted+Succeeded (partial, re-usable),
Interrupted+Failed (partial, discard).
PartialEq is hand-written (control facts only); Eq is dropped — see the
impl PartialEq below.
Fields§
§disposition: Disposition§validity: Validity§reason: Option<String>SRD-92 — optional human reason (the first failing child’s message),
absorbing the parallel (Outcome, Option<String>) tuple the scenario
shell carries today. None for clean outcomes; set via
Outcome::with_reason. Dropping Copy (a String is not Copy)
is the cost — by-value reuses become moves/clones. Serialized only
when present, so axis-only Outcome JSON round-trips unchanged.
payload: Option<Arc<dyn Payload>>SRD-92 / ExecUnification — the optional opaque return payload a unit
may carry above the leaf-projection boundary (the op leaf fills it via
Outcome::with_payload; aggregates leave it None). Arc (not Box)
so Outcome stays Clone; #[serde(skip)] because it is runtime-only,
so axis-only JSON round-trips unchanged. Excluded from PartialEq — it
is data, not control identity. Its contents are the deferred data layer.
Implementations§
Source§impl Outcome
impl Outcome
pub const fn new(disposition: Disposition, validity: Validity) -> Self
Sourcepub const fn failed() -> Self
pub const fn failed() -> Self
Stopped early, result untrustworthy — the SRD-83 fail effect
/ a StopCause::Fault.
Sourcepub const fn completed_failed() -> Self
pub const fn completed_failed() -> Self
SRD-92 — ran fully but the result is untrustworthy (a ran-and-errored
op): Completed+Failed. Distinct from Outcome::failed
(Interrupted+Failed — stopped early by a fault).
Sourcepub const fn interrupted() -> Self
pub const fn interrupted() -> Self
Stopped early, partial result usable — the SRD-83 stop effect
/ a StopCause::Interrupt (e.g. user Ctrl-C, budget met).
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
SRD-92 — attach the human reason (the failing child’s message). Used
by the flow-Outcome-up step so the leaf shells / aggregate fold carry
the message that the ?-propagation path needs, retiring the parallel
(Outcome, Option<String>) tuple.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Binary pass/fail projection for session-level counting: the
only red mark is an untrustworthy result. Interrupted + Succeeded (Ctrl-C, budget met, cursor-suspend) and Skipped
are non-failures from the operator’s perspective.
Sourcepub fn glyph(&self) -> char
pub fn glyph(&self) -> char
Glyph for compact rendering. One per meaningful axis pair (SRD-82 Part 1): ✓ ran-and-trustworthy, ✗ untrustworthy (whether it ran fully or not), … re-usable partial progress, ~ never started, ⋯ still in flight.
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
All-lowercase short label, stable for log lines / CI greps /
the sqlite status column. The axes yield five terminal
labels; interrupted subsumes the retired cursor_suspended
(a resume cursor on the outcome carries the resumability
signal — SRD-82 Part 1).
Sourcepub fn with_payload(self, payload: Arc<dyn Payload>) -> Self
pub fn with_payload(self, payload: Arc<dyn Payload>) -> Self
SRD-92 / ExecUnification — attach the opaque return Payload (the op
leaf’s body, lifted at the projection boundary in a later step).
Aggregates never call this — the payload rides the leaf’s Outcome and
is ignored by the fold.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Outcome
impl<'de> Deserialize<'de> for Outcome
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>,
Source§impl PartialEq for Outcome
SRD-92 / ExecUnification — equality over the CONTROL FACTS only
(disposition, validity, reason). The payload is intentionally
excluded: it is data, not control identity, so two outcomes that differ
only in their payload compare equal. Do NOT “fix” this to compare payloads —
dyn Payload is not PartialEq, and aggregation / tests key on control
facts, never the payload. (Eq is dropped: it is unused — no
HashSet/HashMap<Outcome> exists — and a dyn field can’t satisfy it.)
impl PartialEq for Outcome
SRD-92 / ExecUnification — equality over the CONTROL FACTS only
(disposition, validity, reason). The payload is intentionally
excluded: it is data, not control identity, so two outcomes that differ
only in their payload compare equal. Do NOT “fix” this to compare payloads —
dyn Payload is not PartialEq, and aggregation / tests key on control
facts, never the payload. (Eq is dropped: it is unused — no
HashSet/HashMap<Outcome> exists — and a dyn field can’t satisfy it.)
Auto Trait Implementations§
impl !RefUnwindSafe for Outcome
impl !UnwindSafe for Outcome
impl Freeze for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
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<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