pub struct StateGraph {
pub initial: Option<String>,
pub live: Option<String>,
pub states: Option<Vec<String>>,
pub transitions: Option<HashMap<String, Vec<String>>>,
}Fields§
§initial: Option<String>Initial is the state a fresh document starts in — "draft". A stored document with no status at all is read as this too.
live: Option<String>Live is the ONE state that is publicly readable — "published". The site pulls only documents in it, so reaching Live IS site-publish; every other state is invisible to a reader.
states: Option<Vec<String>>States is every lifecycle state in canonical order: draft, in_review, approved, queued, published, archived. The console lays its board columns out in exactly this order, so the order is part of the answer.
transitions: Option<HashMap<String, Vec<String>>>Transitions maps each state to the states it may move to. A target absent from a state’s list is REFUSED, at the endpoint and again at the storage boundary — this is the whole rule, not a hint for the UI. A state never lists itself; a move that changes nothing is always legal.
Implementations§
Source§impl StateGraph
impl StateGraph
pub fn new() -> StateGraph
Trait Implementations§
Source§impl Clone for StateGraph
impl Clone for StateGraph
Source§fn clone(&self) -> StateGraph
fn clone(&self) -> StateGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more