Skip to main content

commy_sdk_rust/
lib.rs

1//! Commy Rust Client SDK
2//!
3//! A high-level Rust client for interacting with the Commy shared memory coordination system.
4//!
5//! # Features
6//!
7//! - WebSocket Secure (WSS) client for remote connections
8//! - Direct memory-mapping support for local processes
9//! - Automatic connection management with reconnection
10//! - Full async/await support with Tokio
11//! - Multiple authentication methods
12//!
13//! # Example
14//!
15//! ```no_run
16//! use commy_sdk_rust::{Client, auth};
17//!
18//! #[tokio::main]
19//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
20//!     // Create a new client
21//!     let client = Client::new("wss://localhost:9000");
22//!     
23//!     // Connect to server
24//!     client.connect().await?;
25//!     
26//!     // Authenticate with a tenant
27//!     client.authenticate("my_tenant", auth::api_key("api_key_value".to_string())).await?;
28//!     
29//!     // Create or get a service
30//!     let _service = client.get_service("my_tenant", "config").await?;
31//!     
32//!     Ok(())
33//! }
34//! ```
35
36pub mod auth;
37pub mod client;
38pub mod connection;
39pub mod error;
40pub mod examples_support;
41pub mod file_accessor;
42pub mod message;
43pub mod service;
44pub mod state;
45pub mod virtual_file;
46pub mod watcher;
47
48pub use client::Client;
49pub use error::{CommyError, Result};
50pub use examples_support::{CommyServer, ServerConfig};
51pub use message::{ClientMessage, ServerMessage};
52pub use service::Service;
53
54/// Library version
55pub const VERSION: &str = env!("CARGO_PKG_VERSION");