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.
Object Safety§
This trait is not object safe.