pub struct PlanStore { /* private fields */ }Expand description
Persist and authenticate sealed plans at paths derived from JournalPaths.
Implementations§
Source§impl PlanStore
impl PlanStore
Sourcepub fn new(paths: JournalPaths) -> Self
pub fn new(paths: JournalPaths) -> Self
Create a store rooted beside paths’ release-journal root.
Sourcepub fn save(
&self,
plan: &ReleasePlan,
contract: &Contract,
) -> Result<(), PlanStoreError>
pub fn save( &self, plan: &ReleasePlan, contract: &Contract, ) -> Result<(), PlanStoreError>
Create a document if absent. A same-byte retry is a no-op; any other content under the same address is an integrity violation.
Sourcepub fn load(&self, plan_id: &str) -> Result<Option<ReleasePlan>, PlanStoreError>
pub fn load(&self, plan_id: &str) -> Result<Option<ReleasePlan>, PlanStoreError>
Load and authenticate a plan. Missing plans are the compatibility path for plans made by older binaries or on another machine.
Sourcepub fn discard(&self, plan_id: &str) -> Result<DiscardOutcome, PlanStoreError>
pub fn discard(&self, plan_id: &str) -> Result<DiscardOutcome, PlanStoreError>
Authenticate and remove a sealed plan document.
A durable marker distinguishes an idempotent retry from a well-formed but genuinely unknown address. A present document is fully authenticated before deletion, so corruption is never erased under the guise of disposal. Callers coordinating this with release-run creation must hold the repository’s single-active-cut lock.