pub enum Outcome {
Closed,
Interrupted,
}Expand description
How an episode ended, as the record states it.
use majordomus_cli::session::Outcome;
// the one thing about an ended session that changes what somebody does next
assert_eq!(Outcome::Interrupted.as_str(), "interrupted");
assert_ne!(Outcome::Closed, Outcome::Interrupted);Two values, both self-reported and neither verified — the record says so. closed is a
worker ending an episode deliberately; interrupted tells the next reader that the
episode was cut short and its records may be incomplete, which is the one thing about an
ended session that changes what somebody does next. A recovery sweep always writes
interrupted, because an episode nobody ended is by definition one nobody finished.
Variants§
Closed
A worker ended the episode.
Interrupted
The episode was cut short: a crash, a killed process, or a recovery sweep.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word as serialised, which is the word the record carries and the word a resuming worker reads to learn whether the episode was finished or cut short.
use majordomus_cli::session::Outcome;
assert_eq!(Outcome::Closed.as_str(), "closed");
assert_eq!(Outcome::Interrupted.as_str(), "interrupted");Trait Implementations§
impl Copy for Outcome
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Outcome
Source§impl JsonSchema for Outcome
impl JsonSchema for Outcome
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Outcome
impl Ord for Outcome
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Outcome
impl PartialOrd for Outcome
impl StructuralPartialEq for Outcome
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
impl UnwindSafe 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
Mutably borrows from an owned value. Read more
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.