ubiquisync-core 0.0.3

Core protocol types and sync engine for Ubiquisync — conflict-free sync of structured data over commodity cloud storage or a dedicated server.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! [`Replica`]: a store readable and writable for any origin — the oplog.

use super::processor::LogProcessor;
use super::source::LogSource;

/// A full replica: readable ([`LogSource`]) and writable for any origin
/// ([`LogProcessor`]). The SQL oplog is this, so one type serves, relays, and
/// merges. Contrast [`FileLogReplica`](super::FileLogReplica), which writes only
/// its own origin.
pub trait Replica<E>: LogProcessor<E> + LogSource<E> {}

/// Anything that is both is a [`Replica`].
impl<E, T: LogProcessor<E> + LogSource<E>> Replica<E> for T {}