sync15/
lib.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#![allow(unknown_lints, clippy::implicit_hasher)]
6#![warn(rust_2018_idioms)]
7
8pub mod bso;
9#[cfg(feature = "sync-client")]
10pub mod client;
11// Type to describe device types
12mod device_type;
13// Types to describe client records
14mod client_types;
15// Note that `clients_engine` should probably be in `sync_client`, but let's not make
16// things too nested at this stage...
17#[cfg(feature = "sync-client")]
18pub mod clients_engine;
19#[cfg(feature = "crypto")]
20mod enc_payload;
21#[cfg(feature = "sync-engine")]
22pub mod engine;
23mod error;
24#[cfg(feature = "crypto")]
25mod key_bundle;
26mod record_types;
27mod server_timestamp;
28pub mod telemetry;
29
30pub use crate::client_types::{ClientData, RemoteClient};
31pub use crate::device_type::DeviceType;
32pub use crate::error::{Error, Result};
33#[cfg(feature = "crypto")]
34pub use enc_payload::EncryptedPayload;
35#[cfg(feature = "crypto")]
36pub use key_bundle::KeyBundle;
37pub use server_timestamp::ServerTimestamp;
38pub use sync_guid::Guid;
39
40// Collection names are almost always `static, so we use a `Cow`:
41// * Either a `String` or a `'static &str` can be `.into()`'d into one of these.
42// * Cloning one with a `'static &str` is extremely cheap and doesn't allocate memory.
43pub type CollectionName = std::borrow::Cow<'static, str>;
44
45// For skip_serializing_if
46fn skip_if_default<T: PartialEq + Default>(v: &T) -> bool {
47    *v == T::default()
48}
49
50uniffi::include_scaffolding!("sync15");