Skip to main content

ProductionStore

Trait ProductionStore 

Source
pub trait ProductionStore: ProductionRead {
    type Lease: JobLease;
    type ReadSession: ProductionReadSession;
    type Transaction<'production>: ProductionStoreTransaction<Lease = Self::Lease>
       where Self: 'production;

    // Required methods
    fn import_job_lease(&mut self, token: &str) -> Result<Self::Lease>;
    fn read_session(&self) -> Result<Self::ReadSession>;
    fn begin_edit(
        &mut self,
        base: DecisionBase,
    ) -> Result<Self::Transaction<'_>>;
    fn begin_transaction(&mut self) -> Result<Self::Transaction<'_>>;
    fn begin_transaction_at(
        &mut self,
        base_revision: RevisionId,
    ) -> Result<Self::Transaction<'_>>;
}
Expand description

A production persistence backend with explicit domain transactions.

Required Associated Types§

Source

type Lease: JobLease

Backend-owned worker capability shared by its domain edits.

Source

type ReadSession: ProductionReadSession

Independently owned coherent read view.

Source

type Transaction<'production>: ProductionStoreTransaction<Lease = Self::Lease> where Self: 'production

Backend-specific transaction implementation borrowing this store.

Required Methods§

Source

fn import_job_lease(&mut self, token: &str) -> Result<Self::Lease>

Imports explicit scoped credentials against current store authority.

§Errors

Rejects invalid scope/encoding, expired/superseded claims or storage errors.

Source

fn read_session(&self) -> Result<Self::ReadSession>

Opens a coherent view and captures its decision base.

§Errors

Returns storage errors or a changed-production conflict.

Source

fn begin_edit(&mut self, base: DecisionBase) -> Result<Self::Transaction<'_>>

Begins a short write guarded by a production-scoped decision base.

§Errors

Rejects wrong scope and invalid revisions, or returns storage errors.

Source

fn begin_transaction(&mut self) -> Result<Self::Transaction<'_>>

Begins a transaction for domain mutations.

§Errors

Returns a storage-domain error when a transaction cannot be started.

Source

fn begin_transaction_at( &mut self, base_revision: RevisionId, ) -> Result<Self::Transaction<'_>>

Begins a transaction whose decisions were made from base_revision.

Independent additive work may still commit. A commit that touches a non-mergeable semantic fact changed after the base fails atomically with structured conflict detail.

§Errors

Returns crate::ErrorKind::NotFound when the base revision does not exist, or a storage-domain error when a transaction cannot be started.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§