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 memory_pool;
10pub mod query;
11pub mod serialization;
12pub mod storage;
13pub mod sync;
14pub mod transport;
15pub mod devtools;
16
17// Re-export multi-transport functionality
18pub use transport::multi_transport::{MultiTransport, MultiTransportConfig, TransportType, TransportEnum};
19
20// Re-export devtools functionality
21pub use devtools::{DevTools, DevToolsConfig, DevToolsEvent, DevToolsExport, CrdtInspector, CrdtInspection, SyncStats, TransportStats, PerformanceMetrics};
22
23pub mod security;
24
25#[cfg(test)]
26mod wasm_tests;
27
28// Re-export main types for convenience
29pub use collection::LocalFirstCollection;
30pub use crdt::{LwwMap, LwwRegister, Mergeable, ReplicaId};
31pub use error::{CoreError, Result};
32pub use storage::{LocalStorage, StorageError};
33pub use sync::{SyncError, SyncState};
34pub use transport::{SyncTransport, TransportError};
35
36// Re-export common traits and types
37pub use serde::{Deserialize, Serialize};
38pub use async_trait::async_trait;
39
40/// Features available in this crate
41pub mod features {
42    /// Enable encryption support
43    pub const ENCRYPTION: &str = "encryption";
44    
45    /// Enable compression support
46    pub const COMPRESSION: &str = "compression";
47    
48    /// Enable metrics collection
49    pub const METRICS: &str = "metrics";
50    
51    /// Enable distributed tracing
52    pub const TRACING: &str = "tracing";
53}