sync15/engine/mod.rs
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5//! This module is used by crates which need to implement a "sync engine".
6//! At a high-level, a "sync engine" is code which knows how to take records
7//! from a sync server, apply and reconcile them with the local data, then
8//! provide records which should be uploaded to the server.
9//!
10//! Note that the "sync engine" does not itself talk to the server, nor does
11//! it manage the state of the remote server, nor does it do any of the
12//! encryption/decryption - that is the responsbility of the "sync client", as
13//! implemented in the [client] module (or in some cases, implemented externally)
14//!
15//! [SyncEngine](crate::engine::sync_engine::SyncEngine) is a trait which works
16//! on desktop and mobile. Engines implement it once and are driven two ways:
17//! * On mobile, via the [sync manager](crate::sync_manager). Engines manage
18//! their own last-sync time internally.
19//! * On Desktop, by the JS Sync framework via `BridgedEngineWrapper` and the
20//! `uniffi_bridged_engine!` macro.
21mod bridged_engine;
22mod request;
23mod sync_engine;
24
25pub use bridged_engine::BridgedEngineWrapper;
26#[cfg(feature = "sync-client")]
27pub(crate) use request::CollectionPost;
28
29pub use request::{CollectionRequest, RequestOrder};
30pub use sync_engine::{CollSyncIds, EngineSyncAssociation, SyncEngine, SyncEngineId};