pub trait AsyncCm: Sized {
type Error: Error;
type Key;
type Options;
// Required methods
fn new(
options: Self::Options,
) -> impl Future<Output = Result<Self, Self::Error>>;
fn mark_read(&mut self, key: &Self::Key) -> impl Future<Output = ()>;
fn mark_conflict(&mut self, key: &Self::Key) -> impl Future<Output = ()>;
fn has_conflict(&self, other: &Self) -> impl Future<Output = bool>;
fn rollback(&mut self) -> impl Future<Output = Result<(), Self::Error>>;
}
Expand description
The conflict manager that can be used to manage the conflicts in a transaction.
The conflict normally needs to have:
- Contains fingerprints of keys read.
- Contains fingerprints of keys written. This is used for conflict detection.
Required Associated Types§
Required Methods§
Sourcefn new(
options: Self::Options,
) -> impl Future<Output = Result<Self, Self::Error>>
fn new( options: Self::Options, ) -> impl Future<Output = Result<Self, Self::Error>>
Create a new conflict manager with the given options.
Sourcefn mark_conflict(&mut self, key: &Self::Key) -> impl Future<Output = ()>
fn mark_conflict(&mut self, key: &Self::Key) -> impl Future<Output = ()>
Mark the key is .
Sourcefn has_conflict(&self, other: &Self) -> impl Future<Output = bool>
fn has_conflict(&self, other: &Self) -> impl Future<Output = bool>
Returns true if we have a conflict.
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.