Skip to main content

Syncable

Trait Syncable 

Source
pub trait Syncable: ExampleDatabase {
    // Required methods
    fn size(&self) -> impl Future<Output = Location<Self::Family>> + Send;
    fn sync_boundary(
        &self,
    ) -> impl Future<Output = Location<Self::Family>> + Send;
    fn historical_proof(
        &self,
        op_count: Location<Self::Family>,
        start_loc: Location<Self::Family>,
        max_ops: NonZeroU64,
    ) -> impl Future<Output = Result<(Proof<Self::Family, Key>, Vec<Self::Operation>), Error<Self::Family>>> + Send;
    fn pinned_nodes_at(
        &self,
        loc: Location<Self::Family>,
    ) -> impl Future<Output = Result<Vec<Key>, Error<Self::Family>>> + Send;
}
Expand description

Capability trait for databases that support full replay-based sync.

These databases retain enough history to serve authenticated operations over a range, so the client can fetch and replay them into the same database family.

Required Methods§

Source

fn size(&self) -> impl Future<Output = Location<Self::Family>> + Send

Get the total number of operations in the database (including pruned operations).

Source

fn sync_boundary(&self) -> impl Future<Output = Location<Self::Family>> + Send

Get the most recent location from which this database can safely be synced.

Callers constructing a sync target should use this value (or any earlier retained location) as the range.start.

Source

fn historical_proof( &self, op_count: Location<Self::Family>, start_loc: Location<Self::Family>, max_ops: NonZeroU64, ) -> impl Future<Output = Result<(Proof<Self::Family, Key>, Vec<Self::Operation>), Error<Self::Family>>> + Send

Get historical proof and operations.

Source

fn pinned_nodes_at( &self, loc: Location<Self::Family>, ) -> impl Future<Output = Result<Vec<Key>, Error<Self::Family>>> + Send

Get the pinned nodes for a lower operation boundary of loc.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<E> Syncable for commonware_sync::databases::any::Database<E>
where E: Storage + Clock + Metrics,

Source§

impl<E> Syncable for commonware_sync::databases::current::Database<E>
where E: Storage + Clock + Metrics,

Source§

impl<E> Syncable for commonware_sync::databases::immutable::Database<E>
where E: Storage + Clock + Metrics,

Source§

impl<E> Syncable for commonware_sync::databases::keyless::Database<E>
where E: Storage + Clock + Metrics,