amaters-sdk-rust
Rust SDK for AmateRS
Overview
amaters-sdk-rust provides a high-level, ergonomic Rust client library for interacting with AmateRS servers. It handles FHE encryption, network communication, and provides a fluent API for queries.
Features
- Type-Safe API: Compile-time query validation
- FHE Encryption: Automatic client-side encryption
- Connection Management: Pooling and retry logic
- Async/Await: Built on Tokio
- Error Handling: Comprehensive Result types
Installation
Add to Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Quick Start
use ;
async
Usage Examples
Basic Operations
// Insert
client.set.await?;
// Get
let value = client.get.await?;
// Delete
client.delete.await?;
// Check existence
let exists = client.contains.await?;
Queries
use ;
// Filter query
let results = client.query
.collection
.filter
.execute
.await?;
// Range query
let results = client.query
.collection
.range
.execute
.await?;
Batch Operations
// Batch insert
let items = vec!;
client.batch_set.await?;
// Batch get
let keys = vec!;
let results = client.batch_get.await?;
FHE Operations
// Homomorphic addition
let encrypted_result = client.fhe_add.await?;
// Homomorphic comparison
let encrypted_gt = client.fhe_gt.await?;
// Decrypt result locally
let result = client.decrypt?;
Configuration
let client = builder
.endpoint
.timeout
.retry_policy
.tls_config
.build
.await?;
Error Handling
use ;
match client.get.await
Examples
See examples/ directory:
examples/quickstart.rs- Basic usageexamples/queries.rs- Query examplesexamples/batch.rs- Batch operationsexamples/fhe_operations.rs- FHE examples
Testing
# Run tests (requires running server)
# Run integration tests
# Run examples
License
Licensed under MIT OR Apache-2.0
Authors
COOLJAPAN OU (Team KitaSan)