pub struct ConfigStore { /* private fields */ }Expand description
One instance per daemon, serialized by its gate lock. No method reads live configuration files. Diagnostic snapshots are validated and redacted; approved delivery bytes may contain vault reference names, never literal secret values.
Implementations§
Source§impl ConfigStore
impl ConfigStore
Sourcepub fn open(root: StoreRoot) -> Self
pub fn open(root: StoreRoot) -> Self
Reads only; the first stamp creates the directory and file. Caller must hold its daemon single-writer/start lock until this instance is dropped.
Sourcepub fn check(&mut self) -> Result<(), StoreError>
pub fn check(&mut self) -> Result<(), StoreError>
Re-check before every authority use, including after delivery writes.
pub fn body(&mut self) -> Result<&StoreBody, StoreError>
pub fn status(&mut self) -> StoreStatus
pub fn take_activities(&mut self) -> Vec<StoreActivity>
Sourcepub fn delivery_ready(&mut self) -> Result<(), StoreError>
pub fn delivery_ready(&mut self) -> Result<(), StoreError>
No approval/delivery may rely on a pending revision before this succeeds.
pub fn retry_anchor(&mut self) -> Result<(), StoreError>
Source§impl ConfigStore
impl ConfigStore
Sourcepub fn commit_generation(
&mut self,
entry: HistoryEntry,
approved: Snapshot,
observed: Snapshot,
now_ms: u64,
) -> Result<u64, StoreError>
pub fn commit_generation( &mut self, entry: HistoryEntry, approved: Snapshot, observed: Snapshot, now_ms: u64, ) -> Result<u64, StoreError>
Receives a fully approved generation. observed must be a fresh snapshot
of all files, not only the plan’s read set, so unrelated edits survive
proposal rebasing. The caller has checked plan freshness and approval.
Sourcepub fn recovery_exit(
&mut self,
entry: HistoryEntry,
snapshot: Snapshot,
now_ms: u64,
) -> Result<u64, StoreError>
pub fn recovery_exit( &mut self, entry: HistoryEntry, snapshot: Snapshot, now_ms: u64, ) -> Result<u64, StoreError>
Approved recovery exits discard every record from the rejected store. Only a present readable keychain item’s high-water survives. The caller supplies a newly validated file snapshot and approval, just as for stamp.
Sourcepub fn observe(&mut self, snapshot: Snapshot) -> Result<bool, StoreError>
pub fn observe(&mut self, snapshot: Snapshot) -> Result<bool, StoreError>
Before stamp this is informational and never creates a store file.
Sourcepub fn record_delivery(
&mut self,
tuple: &Tuple,
generation: u64,
ack: bool,
) -> Result<(), StoreError>
pub fn record_delivery( &mut self, tuple: &Tuple, generation: u64, ack: bool, ) -> Result<(), StoreError>
ACK/NACK for a superseded generation changes nothing. A failure restores the active pointer immediately, even if its durable mark must wait for an anchor retry. ACKs never change memory while an anchor is pending.
Nothing is delivered while an earlier anchor is pending. Once repaired,
an unanchored NACKed generation may return at most once per daemon start,
never within one run and never after its failure is anchored. The crash
window and persistent-keychain-failure proof is
config_delivery_anchor_pending_restart_before_failure_anchor_may_redeliver_once.
pub fn rollback_configuration( &mut self, generation: u64, ) -> Result<Snapshot, StoreError>
Source§impl ConfigStore
impl ConfigStore
Sourcepub fn resume_delivery(
&mut self,
tuple: &Tuple,
generation: u64,
) -> Result<bool, StoreError>
pub fn resume_delivery( &mut self, tuple: &Tuple, generation: u64, ) -> Result<bool, StoreError>
Persist a resumed attempt before notifying a module after daemon restart. Never-redeliver and superseded targets cannot be resumed.