Skip to main content

appcore_sync/
sync.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: sync.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/05/31 13:38:42 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/07/24 16:07:49 by dnettoRaw
8//      ###########      S: 1.0.1-rc.8
9// =============================================================================
10
11//! Minimal sync contracts and local implementations.
12mod checkpoint;
13mod client;
14mod codec;
15mod discovery;
16mod error;
17mod log;
18mod log_file;
19mod log_file_format;
20mod message_json;
21mod outbox;
22mod outbox_format;
23mod outbox_journal;
24mod outbox_journal_state;
25mod outbox_journal_view;
26mod outbox_size;
27mod outbox_stream;
28mod persistence;
29mod receiver;
30mod retry;
31mod snapshot;
32mod transport;
33mod types;
34mod wire;
35
36pub use checkpoint::{
37    FileSyncCheckpointStore, InMemorySyncCheckpointStore, SyncCheckpointStore,
38    MAX_CHECKPOINT_FILE_BYTES, MAX_CHECKPOINT_PEER_ID_BYTES, MAX_CHECKPOINT_RECORDS,
39    SYNC_CHECKPOINT_FORMAT_V1,
40};
41pub use client::FollowerSyncClient;
42pub use discovery::{discover_dns_sync_peers, SyncPeerAddress, SyncPeerScheme};
43pub use error::{SyncError, SyncResult};
44pub use log::{
45    FileReplicationLog, InMemoryReplicationLog, ReplicationLog, MAX_REPLICATION_PAGE_BYTES,
46    MAX_REPLICATION_PAGE_RECORDS, MAX_SYNC_BATCH_PAYLOAD_BYTES, REPLICATION_LOG_FORMAT_V1,
47};
48pub use message_json::write_sync_message_json;
49pub use outbox::{
50    FileSyncOutbox, InMemorySyncOutbox, SyncOutbox, SyncOutboxReceipt, SyncOutboxStats,
51    MAX_OUTBOX_PAGE_BYTES, MAX_OUTBOX_PAGE_MESSAGES, SYNC_OUTBOX_FORMAT_V2,
52};
53pub use outbox_size::encoded_sync_message_bytes;
54pub use receiver::{SyncReceiveAck, SyncReceiverState};
55pub use retry::{SyncPushMetrics, SyncRetryPolicy};
56pub use snapshot::{ReplicationSnapshot, ReplicationSnapshotRecord, SYNC_SNAPSHOT_FORMAT_V1};
57pub use transport::{
58    decode_sync_message, HttpSyncTransport, SyncTransport, MAX_SYNC_REQUEST_BODY_BYTES,
59};
60pub use types::{
61    compute_events_hash, HeartbeatMessage, LeaderElection, NodeRole, PeerInfo, SyncMessage,
62    SyncStatus,
63};
64pub use wire::{
65    decode_sync_envelope, encode_sync_envelope_v1, SyncEnvelopeV1, SYNC_WIRE_SCHEMA_V1,
66};
67
68#[cfg(test)]
69pub(crate) use transport::read_http_request_body;
70
71#[cfg(test)]
72mod sync_tests;