WireKVS
A Rust client for the WireKVS database service. This client provides a simple interface to interact with WireKVS databases, including real-time updates via WebSocket connections.
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
There are two ways to use the WireKVS client:
1. Direct Database Connection
use WireKVSDatabase;
async
2. Using the Client for Database Management
use WireKVS;
use HashMap;
async
Database Operations
Basic Operations
// Get all entries
let entries = db.get_all_entries.await.unwrap;
// Get a specific value
let value = db.get.await.unwrap;
// Set a value
db.set.await.unwrap;
// Delete a value
db.delete.await.unwrap;
Database Management
// List all databases
let databases = client.list_databases.await.unwrap;
// Delete a database
client.delete_database.await.unwrap;
Real-time Updates
The database instance includes a WebSocket connection for real-time updates. Events are broadcast through a channel that you can subscribe to.
Error Handling
All async methods return Result types that should be handled appropriately:
match db.set.await
Automatic Reconnection
The WebSocket connection is automatically established when creating a database instance.
License
MIT