pub trait CommitStore: Send + Sync {
// Required method
fn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
bundle: CommitBundle,
) -> Pin<Box<dyn Future<Output = Result<CommitReceipt, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The all-or-nothing write of a CommitBundle.
See the module documentation for the atomicity model. The conformance suite
proves the contract with crate::conformance::check_commit_bundle_applies_all,
crate::conformance::check_commit_bundle_atomic_on_invalid_item and
crate::conformance::check_commit_bundle_rejects_foreign_account_items.
This is the one persistence trait with no …Reader / …Writer split,
because it is entirely the write half: a commit is the write. It is
therefore absent from
ReadOnlyStores altogether, which is the
point — a path that only holds the read half cannot name it.
Required Methods§
Sourcefn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
bundle: CommitBundle,
) -> Pin<Box<dyn Future<Output = Result<CommitReceipt, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 AccountId,
bundle: CommitBundle,
) -> Pin<Box<dyn Future<Output = Result<CommitReceipt, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Applies the bundle for account atomically.
§Errors
Any error an item would raise through its own store trait, plus the
refusals of CommitBundle::validate. On error nothing of the bundle
is visible.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".