Skip to main content

PlanCard

Struct PlanCard 

Source
pub struct PlanCard {
    pub text: String,
    pub steps: usize,
    pub done: usize,
    pub finished_steps: Vec<usize>,
    pub settled: bool,
}
Expand description

A plan as the card shows it: its own rendering, how many steps it has and how many of them are done. The step count, not the text, decides how the card ends; the counts, with the card’s run records, decide its header (PlanCard::header_with_runs).

Fields§

§text: String§steps: usize§done: usize

Its steps done.

§finished_steps: Vec<usize>

The steps (zero-based) whose latest outcome is finished: done, or set aside as not needed. A run that ended short on steps all listed here was superseded by the turn (superseded_runs).

§settled: bool

Its records say how it ended: no step is left for its turn to do (each is done, set aside, failed, or handed to a run). Only a settled plan’s header is a verdict the card’s runs could contradict; one still being worked through keeps its own (“Working · step 2 of 4”).

Implementations§

Source§

impl PlanCard

Source

pub fn header_with_runs(&self, runs: &[RunPhase]) -> Option<String>

The header the card shows above this plan’s steps, from the plan’s own state and the phases of the runs on the same card together, so the header never says something the runs’ lines (or the card’s total) contradict. While any run on the card still runs, the work goes on: “continuing in the background”, whatever the plan’s own steps read (live 2026-11-13: “Stopped short · 2 of 4 done” above two helpers that were still working, then finished). Once all ended, a plan whose steps all read done on a card where a run failed or stopped says how that run ended. Otherwise the plan’s own header. None: the plan’s own header stands (a one-step plan has none).

Trait Implementations§

Source§

impl Clone for PlanCard

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 PlanCard

Source§

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

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

impl Default for PlanCard

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for PlanCard

Source§

impl PartialEq for PlanCard

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 PlanCard

Auto Trait Implementations§

§

impl Forget for PlanCard

§

impl Freeze for PlanCard

§

impl Move for PlanCard

§

impl RefUnwindSafe for PlanCard

§

impl Send for PlanCard
where RawVecInner: Send,

§

impl Sync for PlanCard
where RawVecInner: Sync,

§

impl Unpin for PlanCard
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for PlanCard

§

impl UnwindSafe for PlanCard
where RawVecInner: UnwindSafe,

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<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> Same for T

Source§

type Output = T

Should always be Self
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.