Skip to main content

weirdnet_sync/
lib.rs

1//! Linked-device sync: clocks, an op log, merge primitives, sealed pages, a roster and
2//! the `weirdnet-sync/v1` protocol over [`weirdnet-net`](weirdnet_net).
3//!
4//! Record types (bookmarks, notes, and so on) stay in the application. Persistence stays
5//! in the application too; [`OpLog`] is the in-memory log the app can snapshot.
6#![forbid(unsafe_code)]
7
8pub mod hlc;
9pub mod identity;
10pub mod log;
11pub mod merge;
12pub mod net;
13pub mod protocol;
14pub mod record;
15pub mod roster;
16pub mod rotation;
17pub mod seal;
18
19mod bytes;
20mod error;
21
22pub use error::{Result, SyncError};
23pub use hlc::{Hlc, NodeId};
24pub use identity::{FileSecrets, Identity, LinkSettings, SecretStore, Tick};
25pub use log::{LogEntry, OpLog, Page as LogPage};
26pub use merge::{CONFLICT_KEEP_MS, Lww, OrSet, TOMBSTONE_GC_MS, can_gc_tombstone, edit_vs_delete, folder_cycle, lww};
27pub use net::{
28    LinkBundle, MergeOutcome, PullOutcome, SyncHandler, SyncState, node_config, pull_chunks, pull_from, pull_from_outcome, pull_from_shared,
29    start_node,
30};
31pub use protocol::{
32    Ack, Cursors, Envelope, Hello, HelloOk, KeyRef, Message, PAGE_BUDGET, PAGE_MAX, PROTOCOL, Page, Pull, Refuse, RefuseReason, RosterMsg,
33    SYNC_PROFILE, decode, decode_framed, encode, encode_framed,
34};
35pub use record::{Blob, Limits, RecordOptions, RecordRef, RecordValue, SealInfo, Value, chunk_type};
36pub use roster::{CallerCheck, DeviceClass, DeviceGrant, MAX_GRANT_ROLES, MAX_GRANT_TYPES, Roster, SessionCheck, SessionOffer};
37pub use rotation::{Admission, ChainView, Device, DeviceKey, EpochKeys, KeyChain, KeyStatus, Rotation, SealedKey, ValidRotation};
38pub use seal::{SyncKey, SyncType, open_page, page_aad, page_aad_keyed, rotated_sync_key, seal_page, sync_key, sync_key_info};