pub struct State {
pub lifecycle: LifecyclePhase,
pub processes: HashMap<u32, ProcessRecord>,
pub event_version: u64,
pub next_client_id: u64,
pub workspaces: HashMap<String, WorkspaceRecord>,
pub tabs: HashMap<String, TabRecord>,
pub blocks: HashMap<String, BlockRecord>,
pub windows: HashMap<String, WindowRecord>,
}Fields§
§lifecycle: LifecyclePhase§processes: HashMap<u32, ProcessRecord>§event_version: u64§next_client_id: u64§workspaces: HashMap<String, WorkspaceRecord>Phase E.2 — workspaces canonical to the srv reducer.
Bootstrapped from SQLite at startup; subsequent transitions
flow through update. In E.2 the reducer is a session-only
projection — pipe-originated mutations live only in this
map until the process restarts. E.2c adds the persist
subscriber that mirrors changes back to SQLite (idempotent,
version-gated) and migrates HTTP/WS RPC through the reducer.
tabs: HashMap<String, TabRecord>Phase E.2b — tabs canonical to the srv reducer. Keyed by
tab_id; ordering within a workspace is held in
WorkspaceRecord.tab_ids. Bootstrap-loaded from SQLite at
startup alongside workspaces.
blocks: HashMap<String, BlockRecord>Phase E.3 — blocks canonical to the srv reducer. Keyed by
block_id; ordering within a tab is held in
TabRecord.block_ids. Bootstrap-loaded from SQLite at startup
alongside workspaces and tabs.
windows: HashMap<String, WindowRecord>Phase E.5 — window→workspace mapping. Bootstrap-loaded from SQLite Window rows. Mutated by the saga-driven CreateWindow/ CloseWindow/SwitchWorkspace commands; sagas use it to keep window+workspace lifecycle coherent.
Implementations§
Source§impl State
impl State
Sourcepub fn bump_version(&mut self) -> u64
pub fn bump_version(&mut self) -> u64
Increment + return the monotonic event-version counter. Every emitted Event carries a version; subscribers detect gaps for resync (Phase D.3).
Sourcepub fn alloc_client_id(&mut self) -> u64
pub fn alloc_client_id(&mut self) -> u64
Allocate a fresh client_id for a new Register reply.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.