pub trait Cm: Sized {
type Error: Error;
type Key;
type Options;
// Required methods
fn new(options: Self::Options) -> Result<Self, Self::Error>;
fn mark_read(&mut self, key: &Self::Key);
fn mark_conflict(&mut self, key: &Self::Key);
fn has_conflict(&self, other: &Self) -> bool;
fn rollback(&mut self) -> 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) -> Result<Self, Self::Error>
fn new(options: Self::Options) -> Result<Self, Self::Error>
Create a new conflict manager with the given options.
sourcefn mark_conflict(&mut self, key: &Self::Key)
fn mark_conflict(&mut self, key: &Self::Key)
Mark the key is .
sourcefn has_conflict(&self, other: &Self) -> bool
fn has_conflict(&self, other: &Self) -> bool
Returns true if we have a conflict.
Object Safety§
This trait is not object safe.