pub trait Transaction:
Send
+ Sync
+ Sized {
// Required methods
fn commit(self) -> impl Future<Output = Result<()>> + Send;
fn revert(self) -> impl Future + Send;
}
Expand description
A unit of atomicity for updating a shared data source.
The methods provided by this trait can be used to write such pending changes back to persistent storage (commit) so that they become visible to other clients of the same underlying storage, and are saved if the process restarts. It also allows pending changes to be rolled back (revert) so that they are never written back to storage and are no longer reflected even through the data source object which was used to make the changes.
Required Methods§
fn commit(self) -> impl Future<Output = Result<()>> + Send
fn revert(self) -> impl Future + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.