pub trait Syncable: Sized {
type Operation: Operation + Encode + Sync + 'static;
// Required methods
fn create_test_operations(count: usize, seed: u64) -> Vec<Self::Operation>;
fn add_operations(
self,
operations: Vec<Self::Operation>,
) -> impl Future<Output = Result<Self, Error>>;
fn root(&self) -> Key;
fn op_count(&self) -> Location;
fn lower_bound(&self) -> Location;
fn historical_proof(
&self,
op_count: Location,
start_loc: Location,
max_ops: NonZeroU64,
) -> impl Future<Output = Result<(Proof<Key>, Vec<Self::Operation>), Error>> + Send;
fn name() -> &'static str;
}Expand description
Helper trait for databases that can be synced.
Required Associated Types§
Required Methods§
Sourcefn create_test_operations(count: usize, seed: u64) -> Vec<Self::Operation>
fn create_test_operations(count: usize, seed: u64) -> Vec<Self::Operation>
Create test operations with the given count and seed. The returned operations must end with a commit operation.
Sourcefn add_operations(
self,
operations: Vec<Self::Operation>,
) -> impl Future<Output = Result<Self, Error>>
fn add_operations( self, operations: Vec<Self::Operation>, ) -> impl Future<Output = Result<Self, Error>>
Add operations to the database and return the clean database, ignoring any input that doesn’t end with a commit operation (since without a commit, we can’t return a clean DB).
Sourcefn lower_bound(&self) -> Location
fn lower_bound(&self) -> Location
Get the lower bound for operations (inactivity floor or oldest retained location).
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.