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;
26#[cfg(feature = "sync-client")]
27mod record_types;
28mod server_timestamp;
29pub mod telemetry;
30
31pub use crate::client_types::{ClientData, RemoteClient};
32pub use crate::device_type::DeviceType;
33pub use crate::error::{Error, Result};
34#[cfg(feature = "crypto")]
35pub use enc_payload::EncryptedPayload;
36#[cfg(feature = "crypto")]
37pub use key_bundle::KeyBundle;
38pub use server_timestamp::ServerTimestamp;
39pub use sync_guid::Guid;
40
41// Collection names are almost always `static, so we use a `Cow`:
42// * Either a `String` or a `'static &str` can be `.into()`'d into one of these.
43// * Cloning one with a `'static &str` is extremely cheap and doesn't allocate memory.
44pub type CollectionName = std::borrow::Cow<'static, str>;
45
46// For skip_serializing_if
47fn skip_if_default<T: PartialEq + Default>(v: &T) -> bool {
48    *v == T::default()
49}
50
51uniffi::include_scaffolding!("sync15");