pub enum GenerationOutcome {
Created {
series_id: SeriesId,
key: OccurrenceKey,
date: DateKey,
issue_number: u32,
filename: String,
},
NoOp {
series_id: SeriesId,
key: OccurrenceKey,
state: KeyState,
message: String,
},
Rejected {
diagnostics: Vec<GenerationDiagnostic>,
},
}Expand description
The result of one confirmed generation attempt (data-model.md §8, T021).
Exactly one of three shapes, and each is a result, not an error: a surface reports one outcome per candidate, so a refusal is data the caller shows rather than an exception it has to catch.
Variants§
Created
The occurrence was created, linked and recorded.
Fields
§
key: OccurrenceKeyIts occurrence key.
NoOp
The key was already taken: an occurrence exists, or the series skipped it. Nothing was written.
Fields
§
key: OccurrenceKeyThe key that was already taken.
Rejected
The action was refused. Nothing was written.
Fields
§
diagnostics: Vec<GenerationDiagnostic>Every reason, in the order they were found.
Implementations§
Source§impl GenerationOutcome
impl GenerationOutcome
Sourcepub fn is_created(&self) -> bool
pub fn is_created(&self) -> bool
Whether an occurrence was created.
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Whether the action was refused.
Trait Implementations§
Source§impl Clone for GenerationOutcome
impl Clone for GenerationOutcome
Source§impl Debug for GenerationOutcome
impl Debug for GenerationOutcome
impl Eq for GenerationOutcome
Source§impl PartialEq for GenerationOutcome
impl PartialEq for GenerationOutcome
impl StructuralPartialEq for GenerationOutcome
Auto Trait Implementations§
impl Freeze for GenerationOutcome
impl RefUnwindSafe for GenerationOutcome
impl Send for GenerationOutcome
impl Sync for GenerationOutcome
impl Unpin for GenerationOutcome
impl UnsafeUnpin for GenerationOutcome
impl UnwindSafe for GenerationOutcome
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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