1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
//! # AmateRS SDK for Rust
//!
//! This is the official Rust SDK for AmateRS, a Fully Homomorphic Encrypted Database.
//!
//! ## Features
//!
//! - **Client-side encryption**: All encryption/decryption happens on the client
//! - **Connection pooling**: Efficient connection management with automatic reconnection
//! - **Retry logic**: Automatic retries with exponential backoff
//! - **Type-safe queries**: Fluent API for building queries
//! - **Async-first**: Built on Tokio for high performance
//!
//! ## Quick Start
//!
//! ```no_run
//! use amaters_sdk_rust::{AmateRSClient, ClientConfig};
//! use amaters_core::{Key, CipherBlob};
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // Connect to server
//! let client = AmateRSClient::connect("http://localhost:50051").await?;
//!
//! // Set a value
//! let key = Key::from_str("user:123");
//! let value = CipherBlob::new(vec![1, 2, 3, 4]);
//! client.set("users", &key, &value).await?;
//!
//! // Get a value
//! if let Some(retrieved) = client.get("users", &key).await? {
//! println!("Retrieved {} bytes", retrieved.len());
//! }
//!
//! // Delete a key
//! client.delete("users", &key).await?;
//!
//! Ok(())
//! }
//! ```
//!
//! ## Connection Configuration
//!
//! ```no_run
//! use amaters_sdk_rust::{AmateRSClient, ClientConfig, RetryConfig};
//! use std::time::Duration;
//!
//! # async fn example() -> anyhow::Result<()> {
//! let config = ClientConfig::new("http://localhost:50051")
//! .with_connect_timeout(Duration::from_secs(5))
//! .with_request_timeout(Duration::from_secs(30))
//! .with_max_connections(20)
//! .with_retry_config(
//! RetryConfig::new()
//! .with_max_retries(5)
//! .with_initial_backoff(Duration::from_millis(100))
//! );
//!
//! let client = AmateRSClient::connect_with_config(config).await?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Query Builder
//!
//! ```no_run
//! use amaters_sdk_rust::query;
//! use amaters_core::{Key, CipherBlob, col, Predicate};
//!
//! # async fn example() {
//! // Simple query
//! let q = query("users").get(Key::from_str("user:123"));
//!
//! // Filter with predicates
//! let q = query("users")
//! .where_clause()
//! .eq(col("status"), CipherBlob::new(vec![1]))
//! .and(Predicate::Gt(col("age"), CipherBlob::new(vec![18])))
//! .build();
//!
//! // Range query
//! let q = query("data").range(
//! Key::from_str("start"),
//! Key::from_str("end")
//! );
//! # }
//! ```
//!
//! ## FHE Integration
//!
//! The SDK supports client-side encryption with FHE (feature-gated):
//!
//! ```no_run
//! use amaters_sdk_rust::{AmateRSClient, FheEncryptor};
//!
//! # async fn example() -> anyhow::Result<()> {
//! // Create encryptor (stub implementation for now)
//! let encryptor = FheEncryptor::new()?;
//!
//! // Connect with encryptor
//! let client = AmateRSClient::connect("http://localhost:50051")
//! .await?
//! .with_encryptor(encryptor);
//! # Ok(())
//! # }
//! ```
//!
//! ## Feature Flags
//!
//! - `fhe` - Enable full FHE support with TFHE
//! - `serialization` - Enable key serialization with oxicode
// Re-export main types
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export core types for convenience
pub use ;
/// Library version
pub const VERSION: &str = env!;