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`].
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 log;
10pub mod merge;
11pub mod net;
12pub mod protocol;
13pub mod record;
14pub mod roster;
15pub mod rotation;
16pub mod seal;
17
18mod bytes;
19mod error;
20
21pub use error::{Result, SyncError};
22pub use hlc::{Hlc, NodeId};
23pub use log::{LogEntry, OpLog, Page as LogPage};
24pub use merge::{CONFLICT_KEEP_MS, Lww, OrSet, TOMBSTONE_GC_MS, can_gc_tombstone, edit_vs_delete, folder_cycle, lww};
25pub use net::{SyncHandler, SyncState, node_config, pull_chunks, pull_from, start_node};
26pub use protocol::{
27    Ack, Cursors, Envelope, Hello, HelloOk, KeyRef, Message, PAGE_BUDGET, PAGE_MAX, PROTOCOL, Page, Pull, Refuse, RefuseReason, RosterMsg,
28    SYNC_PROFILE, decode, decode_framed, encode, encode_framed,
29};
30pub use record::{Blob, Limits, RecordOptions, RecordRef, RecordValue, SealInfo, Value, chunk_type};
31pub use roster::{CallerCheck, Roster, SessionCheck, SessionOffer};
32pub use rotation::{Admission, ChainView, Device, DeviceKey, EpochKeys, KeyChain, KeyStatus, Rotation, SealedKey, ValidRotation};
33pub use seal::{SyncKey, SyncType, open_page, page_aad, page_aad_keyed, rotated_sync_key, seal_page, sync_key, sync_key_info};