pub struct PlanSnapshot {
pub steps: Vec<Step>,
}Expand description
A serializable full-state snapshot of the plan ledger (#715). Persisted onto
the conversation row so an interrupt + auto-resume can re-hydrate the
in-memory ledger EXACTLY — the ordered steps AND each step’s done/active
status — instead of rebuilding it empty (which loses the <plan> block and
plan_get after a resume). The active step is encoded by its
StepStatus::Active marker, so the snapshot carries no separate index to
drift out of sync.
Unlike StepLedger::set_plan (which takes bare step strings and RESETS
every status — the first step Active, the rest Todo), a snapshot/restore
round-trip preserves which steps are Done and which is Active.
Additive + working memory, not provenance: it rides the conversation row (never a turn), is kept OUT of the §6 content chain, and an empty snapshot is skipped on serialize so it never bloats the on-disk file.
Fields§
§steps: Vec<Step>The ordered steps with each one’s status. #[serde(default)] so the
historically-true empty backfill ({}) on an older db parses cleanly.
Implementations§
Trait Implementations§
Source§impl Clone for PlanSnapshot
impl Clone for PlanSnapshot
Source§fn clone(&self) -> PlanSnapshot
fn clone(&self) -> PlanSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlanSnapshot
impl Debug for PlanSnapshot
Source§impl Default for PlanSnapshot
impl Default for PlanSnapshot
Source§fn default() -> PlanSnapshot
fn default() -> PlanSnapshot
Source§impl<'de> Deserialize<'de> for PlanSnapshot
impl<'de> Deserialize<'de> for PlanSnapshot
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>,
impl Eq for PlanSnapshot
Source§impl PartialEq for PlanSnapshot
impl PartialEq for PlanSnapshot
Source§impl Serialize for PlanSnapshot
impl Serialize for PlanSnapshot
impl StructuralPartialEq for PlanSnapshot
Auto Trait Implementations§
impl Freeze for PlanSnapshot
impl RefUnwindSafe for PlanSnapshot
impl Send for PlanSnapshot
impl Sync for PlanSnapshot
impl Unpin for PlanSnapshot
impl UnsafeUnpin for PlanSnapshot
impl UnwindSafe for PlanSnapshot
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
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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