1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2023-2024 Hugo Osvaldo Barrera
//
// SPDX-License-Identifier: EUPL-1.2
//! Components used for synchronising storages.
//!
//! The general gist behind synchronising is:
//!
//! - Create a new [`declare::StoragePair`]. This type specifies which storages and which
//! collections are to be synchronised. A [`status::StatusDatabase`] instance with details of the
//! previous synchronisation should be provided, if it exists.
//! - Use [`plan::Plan::new`] to create a plan, a stream of synchronisation operations. If operations
//! need to be reviewed first, they should be allocated into a single container. For the typical
//! usage, it's best to consume items from the stream as needed.
//! - The stream may contain conflict operations. These can be resolved using a
//! [`conflict::ConflictResolver`], by writing merged files using the `Storage` APIs
//! directly, or by wrapping the stream in a type which applies mutations.
//! - Use the [`execute::Executor`] type to execute operations from the stream. It updates the
//! status database to reflect which items exist on both sides and their metadata. The status
//! database shall be used on the next cycle to understand which items have changed on which
//! sides.
//!
//! The synchronisation algorithm is based on [the algorithm from the original vdirsyncer][orig].
//!
//! [orig]: https://unterwaditzer.net/2016/sync-algorithm.html
pub use SyncError;
pub use Mode;
pub use OneWaySync;
pub use TwoWaySync;