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 remote access protocol, enabling connections to running AimDB instances via Unix domain sockets or serial.

§Overview

The client library offers:

  • Connection Management: AimxConnection over the shared session engine
  • Protocol Implementation: the reshaped AimX handshake + RPC/streaming
  • Instance Discovery: Automatic detection of running AimDB instances
  • Record Operations: list, get, set, subscribe, drain, graph, query

§Usage

use aimdb_client::AimxConnection;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Connect to an AimDB instance by endpoint (a bare path is the `unix://`
    // shorthand; `serial://DEVICE?baud=N` reaches a board). Performs `hello`.
    let conn = AimxConnection::connect("unix:///tmp/aimdb.sock").await?;

    // List all records
    let records = conn.list_records().await?;
    println!("Found {} records", records.len());

    // Get a specific record
    let value = conn.get_record("server::Temperature").await?;
    println!("Temperature: {:?}", value);

    Ok(())
}

Re-exports§

pub use discovery::discover_instances;
pub use discovery::find_instance;
pub use discovery::InstanceInfo;
pub use endpoint::dial;
pub use endpoint::parse_endpoint;
pub use endpoint::ParsedEndpoint;
pub use endpoint::Scheme;
pub use engine::AimxConnection;
pub use engine::DrainResponse;
pub use engine::RecordUpdate;
pub use error::ClientError;
pub use error::ClientResult;
pub use protocol::CLIENT_NAME;

Modules§

discovery
AimDB Instance Discovery
endpoint
Endpoint resolution — map a scheme:// URL (or a bare path) to a transport Dialer, so an operator can pick the transport at runtime the same way records pick one for links.
engine
Engine-based AimX client.
error
Error types for AimDB client library
protocol
AimX Protocol Types

Structs§

RecordMetadata
Metadata about a registered record type
WelcomeMessage
Server welcome message

Constants§

PROTOCOL_VERSION
Version of the AimX wire protocol spoken by this crate.