pub enum LifecycleState {
Pending,
Active,
Deleted,
Purged,
}Expand description
OPP-12 record-lifecycle Phase-1 (0.8.19 Slice 5) — the existence axis.
One mutually-exclusive typed enum stored as TEXT in the canonical_nodes.state
column (schema migration step-20). Semantics (design §2 / plan §1):
Pending = present + versioned but NOT admitted to default retrieval
(quarantine / promotion gate);
Active = admitted to default retrieval (the shipped-corpus default);
Deleted = soft-deleted, retained + recoverable, excluded from default
reads, stays indexed behind the flag;
Purged = terminal, physically erased.
Deleted/Purged are reachable only through the Phase-2/Slice-10
transition/purge verbs — they can NEVER be a create-time state (see
InitialState).
Variants§
Implementations§
Source§impl LifecycleState
impl LifecycleState
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
On-disk canonical_nodes.state spelling. Must match the migration step-20
DEFAULT 'active' and the state = 'active' default-read exclusion.
Sourcepub fn from_str_opt(value: &str) -> Option<Self>
pub fn from_str_opt(value: &str) -> Option<Self>
Parse the on-disk spelling back into the typed enum. None for any value
outside the closed vocabulary (a corrupt/foreign state).
Sourcepub fn legal_next_states(self) -> Vec<LifecycleState>
pub fn legal_next_states(self) -> Vec<LifecycleState>
OPP-12 Phase-1 (0.8.19 Slice 10) — the target states legally reachable from
self via the transition VERB (design §2 legal-transition table). This
is the verb-specific enumeration reported by IllegalTransitionError.legal:
Pending → [Active, Deleted] (promote / reject)
Active → [Deleted] (soft-delete)
Deleted → [Active] (undelete)
Purged → [] (terminal; nothing is reachable)
Purged is DELIBERATELY excluded even from Deleted: reaching purged is
the purge verb’s job (see Engine::purge), NOT a legal transition
target, so reporting it here would mislead a caller into thinking
transition(deleted → purged) is legal when it is not. Likewise Pending
is create-time-only and is never a transition target. Derived directly
from [is_legal_transition_move] so this can never drift from the table.
Trait Implementations§
Source§impl Clone for LifecycleState
impl Clone for LifecycleState
Source§fn clone(&self) -> LifecycleState
fn clone(&self) -> LifecycleState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more