pub enum ItemOutcome {
Succeeded,
Failed(String),
Quarantined(String),
Suspended(String),
Exhausted(String),
Withheld(String),
}Expand description
How one item ended.
Mirrors RunStatus but deliberately coarser: a batch’s census is about what
a human must do next, and “failed” and “exhausted” both mean this item did
not settle. The item’s own run journal holds the detail.
Variants§
Succeeded
Failed(String)
Ran and did not settle — a failure, or a limit.
Quarantined(String)
Set aside for a human. Distinct from failed because the response is different: a failed item may be re-run, a quarantined one must not be touched until someone has looked at it.
Suspended(String)
Waiting on something — an event, a person, a timer.
Not terminal. A batch that suspends items is not finished, and counting a suspension as a failure would send someone to investigate a run that is working exactly as designed.
Exhausted(String)
Paused at a ceiling. Not terminal, and deliberately not Failed: the
item’s run is intact and stays open — an operator’s two honest moves
are raise the ceiling and resume, or cancel — and a pause reported as
a fault teaches the reader to re-run work that is standing. The string
names the ceiling that was hit.
Withheld(String)
Paused because an authority the item acts under was withdrawn. Not
terminal, and not Exhausted: the work stands as it does at a ceiling,
but the move is lifting the halt on that subject rather than raising a
budget. The string names the subject and why it was withdrawn.
Implementations§
Source§impl ItemOutcome
impl ItemOutcome
pub const fn as_str(&self) -> &'static str
Sourcepub fn all(detail: String) -> [Self; 6]
pub fn all(detail: String) -> [Self; 6]
Every outcome, each carrying detail.
The list parse is written over, and the list a store
derives its terminal set from — so a query asking what is still open
answers from the type rather than from a list of strings beside it.
Sourcepub fn parse(tag: &str, detail: String) -> Option<Self>
pub fn parse(tag: &str, detail: String) -> Option<Self>
The inverse of as_str, written over
all for the reason CaseStatus::parse is.
None is damage rather than absence: an item whose outcome cannot be
read has not failed to run, and a census filing it as in-flight keeps
the batch Running forever over a row nobody can explain.
pub const fn is_terminal(&self) -> bool
The stored spellings of every outcome that ends an item.
What a store asks for when it wants the complement: an item is open while it has no outcome or an outcome outside this set, so a non-terminal variant added later is open by construction rather than by somebody remembering to widen a list of strings.
Sourcepub const fn is_settled(&self) -> bool
pub const fn is_settled(&self) -> bool
Whether this item is finished and needs nothing from anybody.
Terminal and settled are different questions, and the difference is the
backlog: Failed and Quarantined are terminal and are exactly what a
person has to see. Written as a match rather than == Succeeded so a
variant added later is unsettled by construction — the safe direction.
The stored spellings of every outcome nobody has to act on.
The set a store negates to build items_needing_attention. Derived
from all for the reason
terminal_tags is: a hand-kept list of strings
stops naming a class of trouble the day somebody adds one.
Trait Implementations§
Source§impl Clone for ItemOutcome
impl Clone for ItemOutcome
Source§impl Debug for ItemOutcome
impl Debug for ItemOutcome
Source§impl<'de> Deserialize<'de> for ItemOutcome
impl<'de> Deserialize<'de> for ItemOutcome
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>,
impl Eq for ItemOutcome
Source§impl PartialEq for ItemOutcome
impl PartialEq for ItemOutcome
Source§impl Serialize for ItemOutcome
impl Serialize for ItemOutcome
impl StructuralPartialEq for ItemOutcome
Auto Trait Implementations§
impl Freeze for ItemOutcome
impl RefUnwindSafe for ItemOutcome
impl Send for ItemOutcome
impl Sync for ItemOutcome
impl Unpin for ItemOutcome
impl UnsafeUnpin for ItemOutcome
impl UnwindSafe for ItemOutcome
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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