Skip to main content

dataflow_rs/function/
outcome.rs

1//! `Outcome`: what a call tells the engine.
2
3/// What a call tells the engine. v3's `TaskOutcome`, unchanged.
4///
5/// Exhaustive on purpose: a host matching on it handles every case, and
6/// a fifth would be a new contract, not a minor addition.
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Outcome {
9    /// Normal completion: the audit trail records status `200`, and the
10    /// workflow continues.
11    Ok,
12    /// Completion with an HTTP-like status, recorded on the audit trail. A
13    /// `4xx` is a rejection and a `5xx` a failure, handled by the task's
14    /// [`on_rejection`](crate::def::TaskDef::on_rejection) and
15    /// [`on_failure`](crate::def::TaskDef::on_failure).
16    Status(u16),
17    /// No audit entry is recorded, and the workflow continues.
18    Skip,
19    /// The audit trail records status `299`, and the rest of the workflow
20    /// does not run. Later workflows still see the message.
21    Halt,
22}