xenith_sync/lib.rs
1//! State sync engine for xenith.
2//!
3//! Provides [`SyncEngine`], which orchestrates cross-chain state propagation by
4//! composing any [`xenith_core::MessagingTransport`] with a pluggable
5//! [`xenith_core::StateStore`]. Depends on [`xenith_core`] for traits and types,
6//! and optionally on [`xenith_read`] for on-chain quorum verification. Diverged
7//! state is never silently resolved — callers always decide.
8//!
9//! ```rust,no_run
10//! use std::sync::Arc;
11//! use xenith_core::{InMemoryStore, ReadStrategy, StateKey};
12//! use xenith_sync::{SyncConfig, SyncEngine};
13//! use bytes::Bytes;
14//!
15//! # async fn example(transport: Arc<dyn xenith_core::MessagingTransport>) {
16//! let engine = SyncEngine::new(
17//! transport,
18//! Arc::new(InMemoryStore::default()),
19//! SyncConfig::default(),
20//! );
21//! # }
22//! ```
23//!
24//! See the [xenith_core] crate for core types and traits.
25
26pub mod engine;
27pub mod json_store;
28pub mod subscription;
29
30pub use engine::{SyncConfig, SyncEngine, SyncReceipt};
31pub use json_store::JsonFileStore;
32pub use subscription::SubscriptionHandle;