Skip to main content

commonware_sync/
lib.rs

1//! Synchronize state between a server and client.
2//!
3//! This example shows how to synchronize a client database to a remote server's database
4//! using [commonware_storage::qmdb::any], [commonware_storage::qmdb::current], or
5//! [commonware_storage::qmdb::immutable].
6//!
7//! It includes network protocols, database configuration, and utilities for creating test data.
8
9#![doc(
10    html_logo_url = "https://commonware.xyz/imgs/rustdoc_logo.svg",
11    html_favicon_url = "https://commonware.xyz/favicon.ico"
12)]
13
14pub mod error;
15pub use error::Error;
16pub mod databases;
17pub mod net;
18pub use databases::{any, current, immutable};
19
20/// Returns the version of the crate.
21pub const fn crate_version() -> &'static str {
22    env!("CARGO_PKG_VERSION")
23}
24
25/// Hasher type used in the database.
26pub type Hasher = commonware_cryptography::sha256::Sha256;
27
28/// Digest type used in the database.
29pub type Digest = commonware_cryptography::sha256::Digest;
30
31/// Key type used in the database.
32pub type Key = commonware_cryptography::sha256::Digest;
33
34/// Value type used in the database.
35pub type Value = commonware_cryptography::sha256::Digest;
36
37/// Translator type for the database.
38pub type Translator = commonware_storage::translator::EightCap;