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(
&mut self,
operations: Vec<Self::Operation>,
) -> impl Future<Output = Result<(), Error>>;
fn root(&self) -> Key;
fn size(&self) -> impl Future<Output = Location> + Send;
fn inactivity_floor(&self) -> impl Future<Output = Location> + Send;
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(
&mut self,
operations: Vec<Self::Operation>,
) -> impl Future<Output = Result<(), Error>>
fn add_operations( &mut self, operations: Vec<Self::Operation>, ) -> impl Future<Output = Result<(), Error>>
Add operations to the database, ignoring any input that doesn’t end with a commit operation.
Sourcefn size(&self) -> impl Future<Output = Location> + Send
fn size(&self) -> impl Future<Output = Location> + Send
Get the total number of operations in the database (including pruned operations).
Sourcefn inactivity_floor(&self) -> impl Future<Output = Location> + Send
fn inactivity_floor(&self) -> impl Future<Output = Location> + Send
Get the inactivity floor, the location below which all operations are inactive.
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.