Debian Codegraph @

third_party/rust/sync15/src/lib.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 #![allow(unknown_lints, clippy::implicit_hasher)]
6 #![warn(rust_2018_idioms)]
7
8 pub mod bso;
9 #[cfg(feature = "sync-client")]
10 pub mod client;
11 // Type to describe device types
12 mod device_type;
13 // Types to describe client records
14 mod 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")]
18 pub mod clients_engine;
19 #[cfg(feature = "crypto")]
20 mod enc_payload;
21 #[cfg(feature = "sync-engine")]
22 pub mod engine;
23 mod error;
24 #[cfg(feature = "crypto")]
25 mod key_bundle;
26 mod record_types;
27 mod server_timestamp;
28 pub mod telemetry;
29
30 pub use crate::client_types::{ClientData, RemoteClient};
31 pub use crate::device_type::DeviceType;
32 pub use crate::error::{Error, Result};
33 #[cfg(feature = "crypto")]
34 pub use enc_payload::EncryptedPayload;
35 #[cfg(feature = "crypto")]
36 pub use key_bundle::KeyBundle;
37 pub use server_timestamp::ServerTimestamp;
38 pub 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.
43 pub type CollectionName = std::borrow::Cow<'static, str>;
44
45 // For skip_serializing_if
46 fn skip_if_default<T: PartialEq + Default>(v: &T) -> bool {
47 *v == T::default()
48 }
49
50 uniffi::include_scaffolding!("sync15");