pub struct ProviderStoreTransaction<'a> { /* private fields */ }Expand description
Provider-store transaction used to propose, compile, then commit exactly one state.
The transaction holds no file lock; state is the base stamp that commit
validates against a fresh on-disk reread before replacing the store.
Implementations§
Source§impl ProviderStoreTransaction<'_>
impl ProviderStoreTransaction<'_>
pub fn snapshot(&self) -> ProviderStoreSnapshot
Sourcepub fn propose_connect(
&self,
request: &ConnectMutation,
current_catalog_revision: &CatalogRevision,
) -> Result<ConnectProposal, ProviderStoreError>
pub fn propose_connect( &self, request: &ConnectMutation, current_catalog_revision: &CatalogRevision, ) -> Result<ConnectProposal, ProviderStoreError>
Validates replay/conflict/revisions and allocates the final connect proposal.
Sourcepub fn propose_disconnect(
&self,
request: &DisconnectMutation,
current_runtime_revision: &RuntimeRevision,
) -> Result<DisconnectProposal, ProviderStoreError>
pub fn propose_disconnect( &self, request: &DisconnectMutation, current_runtime_revision: &RuntimeRevision, ) -> Result<DisconnectProposal, ProviderStoreError>
Validates replay/conflict/revisions/generation and allocates the final disconnect proposal.
Sourcepub fn commit(
self,
proposal: ProposedProviderStore,
) -> Result<CommittedProviderStore, ProviderStoreError>
pub fn commit( self, proposal: ProposedProviderStore, ) -> Result<CommittedProviderStore, ProviderStoreError>
Atomically commits the exact pre-serialized proposal. No revision is allocated here.
The commit re-acquires the store lock, rereads the on-disk state, and
compare-and-swaps the live generation/store_revision against the
proposal’s recorded base. A concurrent commit that landed first yields
ProviderStoreError::Stale and leaves the disk untouched.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ProviderStoreTransaction<'a>
impl<'a> RefUnwindSafe for ProviderStoreTransaction<'a>
impl<'a> Send for ProviderStoreTransaction<'a>
impl<'a> Sync for ProviderStoreTransaction<'a>
impl<'a> Unpin for ProviderStoreTransaction<'a>
impl<'a> UnsafeUnpin for ProviderStoreTransaction<'a>
impl<'a> UnwindSafe for ProviderStoreTransaction<'a>
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
Mutably borrows from an owned value. Read more