leptos_sync_core/
lib.rs

1//! Core synchronization library for Leptos applications
2//! 
3//! This crate provides the foundation for local-first, offline-capable data synchronization
4//! using CRDTs (Conflict-free Replicated Data Types).
5
6pub mod collection;
7pub mod crdt;
8pub mod error;
9pub mod query;
10pub mod storage;
11pub mod sync;
12pub mod transport;
13pub mod security;
14
15#[cfg(test)]
16mod wasm_tests;
17
18// Re-export main types for convenience
19pub use collection::LocalFirstCollection;
20pub use crdt::{LwwMap, LwwRegister, Mergeable, ReplicaId};
21pub use error::{CoreError, Result};
22pub use storage::{LocalStorage, StorageError};
23pub use sync::{SyncError, SyncState};
24pub use transport::{SyncTransport, TransportError};
25
26// Re-export common traits and types
27pub use serde::{Deserialize, Serialize};
28pub use async_trait::async_trait;
29
30/// Features available in this crate
31pub mod features {
32    /// Enable encryption support
33    pub const ENCRYPTION: &str = "encryption";
34    
35    /// Enable compression support
36    pub const COMPRESSION: &str = "compression";
37    
38    /// Enable metrics collection
39    pub const METRICS: &str = "metrics";
40    
41    /// Enable distributed tracing
42    pub const TRACING: &str = "tracing";
43}