Skip to main content

synap_sdk/
lib.rs

1//! # Synap Rust SDK
2//!
3//! Official Rust client for Synap - High-Performance In-Memory Key-Value Store & Message Broker
4//!
5//! ## Features
6//!
7//! - 💾 **Key-Value Store**: Fast in-memory KV operations with TTL support
8//! - 📨 **Message Queues**: RabbitMQ-style queues with ACK/NACK
9//! - 📡 **Event Streams**: Kafka-style event streams with offset tracking
10//! - 🔔 **Pub/Sub**: Topic-based publish/subscribe with wildcards
11//! - 🔄 **Async/Await**: Built on Tokio for high-performance async I/O
12//! - 🛡️ **Type-Safe**: Leverages Rust's type system for correctness
13//!
14//! ## Quick Start
15//!
16//! ```rust,no_run
17//! use synap_sdk::{SynapClient, SynapConfig};
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
21//!     // Create client
22//!     let config = SynapConfig::new("http://localhost:15500");
23//!     let client = SynapClient::new(config)?;
24//!
25//!     // Key-Value operations
26//!     client.kv().set("user:1", "John Doe", None).await?;
27//!     let value: Option<String> = client.kv().get("user:1").await?;
28//!     tracing::info!("Value: {:?}", value);
29//!
30//!     Ok(())
31//! }
32//! ```
33
34pub mod bitmap;
35pub mod client;
36pub mod error;
37pub mod geospatial;
38pub mod hash;
39pub mod hyperloglog;
40pub mod kv;
41pub mod list;
42pub mod pubsub;
43mod pubsub_reactive;
44pub mod queue;
45mod queue_reactive;
46pub mod reactive;
47pub mod rx; // RxJS-style reactive programming
48pub mod scripting;
49pub mod set;
50pub mod sorted_set;
51pub mod stream;
52mod stream_reactive;
53pub mod transactions;
54pub mod transport;
55pub mod types;
56
57pub use bitmap::{BitmapManager, BitmapOperation, BitmapStats};
58pub use client::{SynapClient, SynapConfig};
59pub use error::{Result, SynapError};
60pub use geospatial::{
61    Coordinate, DistanceUnit, GeoradiusResult, GeospatialManager, GeospatialStats, Location,
62};
63pub use hash::HashManager;
64pub use hyperloglog::HyperLogLogManager;
65pub use kv::KVStore;
66pub use list::ListManager;
67pub use pubsub::PubSubManager;
68pub use queue::QueueManager;
69pub use reactive::{MessageStream, SubscriptionHandle};
70pub use scripting::{
71    ScriptEvalOptions, ScriptEvalResponse, ScriptExistsResponse, ScriptFlushResponse,
72    ScriptKillResponse, ScriptManager,
73};
74pub use set::SetManager;
75pub use sorted_set::{ScoredMember, SortedSetManager, SortedSetStats};
76pub use stream::StreamManager;
77pub use transactions::{
78    TransactionCommandClient, TransactionExecResult, TransactionManager, TransactionOptions,
79    TransactionResponse,
80};
81pub use transport::TransportMode;
82pub use types::HyperLogLogStats;