Debian Codegraph @

third_party/rust/sync15/src/engine/mod.rs

raw
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 //! There are currently 2 types of engine:
16 //! * Code which implements the [crate::engine::sync_engine::SyncEngine]
17 //! trait. These are the "original" Rust engines, designed to be used with
18 //! the [crate::client](sync client)
19 //! * Code which implements the [crate::engine::bridged_engine::BridgedEngine]
20 //! trait. These engines are a "bridge" between the Desktop JS Sync world and
21 //! this rust code.
22 //!
23 //! While these engines end up doing the same thing, the difference is due to
24 //! implementation differences between the Desktop Sync client and the Rust
25 //! client.
26 //!
27 //! We intend merging these engines - the first step will be to merge the
28 //! types and payload management used by these traits, then to combine the
29 //! requirements into a single trait that captures both use-cases.
30 mod bridged_engine;
31 mod request;
32 mod sync_engine;
33
34 pub use bridged_engine::{ApplyResults, BridgedEngine, BridgedEngineAdaptor};
35 #[cfg(feature = "sync-client")]
36 pub(crate) use request::CollectionPost;
37
38 pub use request::{CollectionRequest, RequestOrder};
39 pub use sync_engine::{CollSyncIds, EngineSyncAssociation, SyncEngine, SyncEngineId};