Skip to main content

Crate aimdb_client

Crate aimdb_client 

Source
Expand description

AimDB Client Library

This library provides a client implementation for the AimX v1 remote access protocol, enabling connections to running AimDB instances via Unix domain sockets.

§Overview

The client library offers:

  • Connection Management: Async client for Unix domain socket communication
  • Protocol Implementation: AimX v1 handshake and message handling
  • Instance Discovery: Automatic detection of running AimDB instances
  • Record Operations: List, get, set, subscribe to records

§Usage

use aimdb_client::AimxClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Connect to an AimDB instance
    let mut client = AimxClient::connect("/tmp/aimdb.sock").await?;
     
    // List all records
    let records = client.list_records().await?;
    println!("Found {} records", records.len());
     
    // Get a specific record
    let value = client.get_record("server::Temperature").await?;
    println!("Temperature: {:?}", value);
     
    Ok(())
}

Re-exports§

pub use connection::AimxClient;
pub use connection::DrainResponse;
pub use discovery::discover_instances;
pub use discovery::find_instance;
pub use discovery::InstanceInfo;
pub use error::ClientError;
pub use error::ClientResult;
pub use protocol::cli_hello;
pub use protocol::parse_message;
pub use protocol::serialize_message;
pub use protocol::EventMessage;
pub use protocol::RequestExt;
pub use protocol::ResponseExt;
pub use protocol::CLIENT_NAME;
pub use protocol::PROTOCOL_VERSION;

Modules§

connection
AimX Client Connection
discovery
AimDB Instance Discovery
error
Error types for AimDB client library
protocol
AimX Protocol Types and Utilities

Structs§

Event
Event message from server (subscription push)
RecordMetadata
Metadata about a registered record type
Request
Request message from client
WelcomeMessage
Server welcome message

Enums§

Response
Response message from server