Skip to main content

LifecycleOutcome

Enum LifecycleOutcome 

Source
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: LifecycleAction

The action that was carried out.

§schedule_id: CycleScheduleId

The schedule it acted on.

§cycle_id: Option<GeneratedCycleId>

The instance it acted on, when it named one.

§snapshot_path: Option<String>

The captured snapshot, project-relative, when one was written.

§dates: Option<(String, String)>

The resulting (start_date, due_date), when the action moved a window.

§message: String

One sentence for a surface.

§

NoOp

The action’s postcondition already held; nothing was written.

Fields

§action: LifecycleAction

The action that was requested.

§schedule_id: CycleScheduleId

The schedule it named.

§cycle_id: Option<GeneratedCycleId>

The instance it named, when it named one.

§message: String

One sentence saying why nothing was written.

§

Rejected

The action was refused. Nothing was written.

Fields

§action: LifecycleAction

The action that was requested.

§schedule_id: CycleScheduleId

The 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

Source

pub fn as_str(&self) -> &'static str

The stable word a surface prints: applied, no-op or rejected.

Source

pub fn is_applied(&self) -> bool

Whether something was written.

Source

pub fn is_noop(&self) -> bool

Whether the postcondition already held.

Source

pub fn is_rejected(&self) -> bool

Whether the action was refused.

Source

pub fn action(&self) -> LifecycleAction

The action the outcome is about.

Source

pub fn schedule_id(&self) -> &CycleScheduleId

The schedule the outcome is about.

Source

pub fn cycle_id(&self) -> Option<&GeneratedCycleId>

The instance the outcome concerns, when it concerns one.

Source

pub fn snapshot_path(&self) -> Option<&str>

The captured snapshot, project-relative, present on an applied close.

Source

pub fn dates(&self) -> Option<&(String, String)>

The resulting dates, present on an action that moved a window.

Source

pub fn diagnostics(&self) -> &[LifecycleDiagnostic]

Every diagnostic, empty for applied and no-op.

Source

pub fn render(&self) -> String

One line for a surface.

Trait Implementations§

Source§

impl Clone for LifecycleOutcome

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LifecycleOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for LifecycleOutcome

Source§

impl PartialEq for LifecycleOutcome

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LifecycleOutcome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.