Skip to main content

smg_mesh/
lib.rs

1//! Mesh Gossip Protocol and Distributed State Synchronization
2//!
3//! This crate provides mesh networking capabilities for distributed cluster state management:
4//! - Gossip protocol for node discovery and failure detection
5//! - CRDT-based state synchronization across cluster nodes
6//! - Consistent hashing for request routing
7//! - Partition detection and recovery
8
9mod consistent_hash;
10mod controller;
11mod crdt_kv;
12mod flow_control;
13mod incremental;
14mod metrics;
15mod mtls;
16mod node_state_machine;
17mod partition;
18mod ping_server;
19mod rate_limit_window;
20mod service;
21mod stores;
22mod sync;
23mod topology;
24mod tree_ops;
25
26// Internal tests module with full access to private types
27#[cfg(test)]
28mod tests;
29
30// Re-export commonly used types
31pub use crdt_kv::{CrdtOrMap, OperationLog};
32pub use metrics::init_mesh_metrics;
33pub use mtls::{MTLSConfig, MTLSManager, OptionalMTLSManager};
34pub use partition::PartitionDetector;
35pub use rate_limit_window::RateLimitWindow;
36pub use service::{gossip, ClusterState, MeshServerBuilder, MeshServerConfig, MeshServerHandler};
37pub use stores::{
38    AppState, MembershipState, RateLimitConfig, StateStores, WorkerState,
39    GLOBAL_RATE_LIMIT_COUNTER_KEY, GLOBAL_RATE_LIMIT_KEY,
40};
41pub use sync::{
42    MeshSyncManager, OptionalMeshSyncManager, TreeStateSubscriber, WorkerStateSubscriber,
43};
44pub use tree_ops::{
45    hash_node_path, hash_token_path, lz4_compress, lz4_decompress, TenantDelta, TenantEvict,
46    TenantInsert, TreeInsertOp, TreeKey, TreeOperation, TreeRemoveOp, TreeState,
47    GLOBAL_EVICTION_HASH,
48};