amaters-sdk-rust
Rust client SDK for AmateRS — a distributed, Fully Homomorphic Encrypted (FHE) database system.
Status: Alpha — API is stabilising. Not yet recommended for production use.
Overview
amaters-sdk-rust provides a high-level, ergonomic Rust client library for interacting with AmateRS servers. It covers connection lifecycle management (including health checks and automatic reconnection), a client-side LRU/TTL cache, cursor-based pagination with blake3 integrity verification, flexible sorting, batch operations, and range queries.
- 126 tests
- 191 public API items
- Version: 0.2.0
- License: Apache-2.0
Features
- Connection manager — pooling, health checks, and automatic reconnection
- Client-side caching — LRU eviction with configurable TTL per entry
- Cursor-based pagination — stateless cursors with blake3 integrity checks
- Sorting — order results by key, value, timestamp, or size
- Batch operations — multi-key get/set/delete in a single round-trip
- Range queries — efficient key-range scans
- Streaming queries —
stream_query()returnsQueryStream(implementsfutures::Stream); backpressure via boundedtokio::sync::mpsc; cooperative cancellation viaCancellationTokenfromtokio_util::sync - Property-based tests — proptest strategies for
QueryBuilder,AmatersError, and codec round-trips - Async/Await — built on Tokio
- Comprehensive error types — structured
Result-based API throughout
Installation
Add to Cargo.toml:
[]
= "0.2"
= { = "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?;
Batch Operations
// Batch insert
let items = vec!;
client.batch_set.await?;
// Batch get
let keys = vec!;
let results = client.batch_get.await?;
Range Queries
let results = client
.range
.await?;
Cursor-Based Pagination
let page = client
.scan
.limit
.cursor // blake3-verified cursor
.execute
.await?;
let next_cursor = page.next_cursor;
Sorting
use SortBy;
let results = client
.scan
.sort_by
.execute
.await?;
Connection Configuration
use Duration;
let config = builder
.endpoint
.connect_timeout
.request_timeout
.max_reconnect_attempts
.cache_capacity
.cache_ttl
.build?;
let client = connect.await?;
Testing
# Run all tests
# Run with all features
License
Apache-2.0
Authors
COOLJAPAN OU (Team KitaSan) Source: https://github.com/cool-japan/amaters