pub enum LifecycleOutcome {
Applied {
action: LifecycleAction,
schedule_id: CycleScheduleId,
cycle_id: Option<GeneratedCycleId>,
snapshot_path: Option<String>,
dates: Option<(String, String)>,
message: String,
},
NoOp {
action: LifecycleAction,
schedule_id: CycleScheduleId,
cycle_id: Option<GeneratedCycleId>,
message: String,
},
Rejected {
action: LifecycleAction,
schedule_id: CycleScheduleId,
cycle_id: Option<GeneratedCycleId>,
diagnostics: Vec<LifecycleDiagnostic>,
},
}Expand description
What one confirmed lifecycle action did (data-model.md §6, T029).
Exactly one of three shapes, each a result rather than an error, so a surface reports it instead of catching it. Exactly one outcome per action.
Variants§
Applied
The action changed something. snapshot_path is present on a close that
captured one, and dates on an action that moved a window.
Fields
action: LifecycleActionThe action that was carried out.
schedule_id: CycleScheduleIdThe schedule it acted on.
cycle_id: Option<GeneratedCycleId>The instance it acted on, when it named one.
NoOp
The action’s postcondition already held; nothing was written.
Fields
action: LifecycleActionThe action that was requested.
schedule_id: CycleScheduleIdThe schedule it named.
cycle_id: Option<GeneratedCycleId>The instance it named, when it named one.
Rejected
The action was refused. Nothing was written.
Fields
action: LifecycleActionThe action that was requested.
schedule_id: CycleScheduleIdThe schedule it named.
cycle_id: Option<GeneratedCycleId>The instance it named, when it named one.
diagnostics: Vec<LifecycleDiagnostic>Every reason, in the order they were found.
Implementations§
Source§impl LifecycleOutcome
impl LifecycleOutcome
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
The stable word a surface prints: applied, no-op or rejected.
Sourcepub fn is_applied(&self) -> bool
pub fn is_applied(&self) -> bool
Whether something was written.
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Whether the action was refused.
Sourcepub fn action(&self) -> LifecycleAction
pub fn action(&self) -> LifecycleAction
The action the outcome is about.
Sourcepub fn schedule_id(&self) -> &CycleScheduleId
pub fn schedule_id(&self) -> &CycleScheduleId
The schedule the outcome is about.
Sourcepub fn cycle_id(&self) -> Option<&GeneratedCycleId>
pub fn cycle_id(&self) -> Option<&GeneratedCycleId>
The instance the outcome concerns, when it concerns one.
Sourcepub fn snapshot_path(&self) -> Option<&str>
pub fn snapshot_path(&self) -> Option<&str>
The captured snapshot, project-relative, present on an applied close.
Sourcepub fn dates(&self) -> Option<&(String, String)>
pub fn dates(&self) -> Option<&(String, String)>
The resulting dates, present on an action that moved a window.
Sourcepub fn diagnostics(&self) -> &[LifecycleDiagnostic]
pub fn diagnostics(&self) -> &[LifecycleDiagnostic]
Every diagnostic, empty for applied and no-op.
Trait Implementations§
Source§impl Clone for LifecycleOutcome
impl Clone for LifecycleOutcome
Source§impl Debug for LifecycleOutcome
impl Debug for LifecycleOutcome
impl Eq for LifecycleOutcome
Source§impl PartialEq for LifecycleOutcome
impl PartialEq for LifecycleOutcome
impl StructuralPartialEq for LifecycleOutcome
Auto Trait Implementations§
impl Freeze for LifecycleOutcome
impl RefUnwindSafe for LifecycleOutcome
impl Send for LifecycleOutcome
impl Sync for LifecycleOutcome
impl Unpin for LifecycleOutcome
impl UnsafeUnpin for LifecycleOutcome
impl UnwindSafe for LifecycleOutcome
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
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
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> ⓘ
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