Skip to main content

hygg_shared/sync/
mod.rs

1//! Types and helpers shared between the hygg client and the sync server.
2//!
3//! - [`identity`]: the content-derived book identity (a stable cross-device
4//!   id).
5//! - [`mode`]: the per-document sync policy (full / metadata / off).
6//! - [`autosync`]: the account/device-wide automatic-sync scope (which
7//!   documents sync at all) plus the "looks like a book" heuristic.
8//! - [`proto`]: the JSON wire contract for the device + sync API, so the AGPL
9//!   client and the Elastic-licensed server stay statically typed against one
10//!   definition without either license crossing the boundary.
11
12pub mod autosync;
13pub mod clock;
14pub mod headers;
15pub mod identity;
16pub mod mode;
17pub mod proto;
18
19pub use autosync::{
20  AutoSyncPolicy, BOOK_MIN_PDF_PAGES, BOOK_MIN_TEXT_LINES, looks_like_book,
21  should_auto_sync,
22};
23pub use identity::{book_id_for_file, book_id_from_text, content_sha256};
24pub use mode::SyncMode;