pub trait Syncable {
type Operation: Clone + Read<Cfg = ()> + Encode + Send + Sync + 'static;
// Required methods
fn create_test_operations(count: usize, seed: u64) -> Vec<Self::Operation>;
fn add_operations(
database: &mut Self,
operations: Vec<Self::Operation>,
) -> impl Future<Output = Result<(), Error>>;
fn commit(&mut self) -> impl Future<Output = Result<(), Error>>;
fn root(&self, hasher: &mut Standard<Sha256>) -> Key;
fn op_count(&self) -> u64;
fn lower_bound_ops(&self) -> u64;
fn historical_proof(
&self,
size: u64,
start_loc: u64,
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.
Sourcefn add_operations(
database: &mut Self,
operations: Vec<Self::Operation>,
) -> impl Future<Output = Result<(), Error>>
fn add_operations( database: &mut Self, operations: Vec<Self::Operation>, ) -> impl Future<Output = Result<(), Error>>
Add operations to the database.
Sourcefn commit(&mut self) -> impl Future<Output = Result<(), Error>>
fn commit(&mut self) -> impl Future<Output = Result<(), Error>>
Commit pending operations to the database.
Sourcefn lower_bound_ops(&self) -> u64
fn lower_bound_ops(&self) -> u64
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.