Skip to main content

Crate haystack_client

Crate haystack_client 

Source
Expand description

Haystack HTTP and WebSocket client library.

Provides HaystackClient for communicating with Project Haystack servers using the standard REST API and optional WebSocket transport for real-time watches.

§Features

  • SCRAM SHA-256 authentication — Automatic handshake on connect
  • HTTP + WebSocket — HTTP for standard ops, WebSocket for watch subscriptions
  • mTLS — Mutual TLS via tls::TlsConfig for certificate-based auth
  • Zinc wire format — Default encoding for fastest serialization
  • 30+ Haystack ops — about, read, nav, hisRead, hisWrite, pointWrite, watchSub, watchPoll, watchUnsub, invokeAction, defs, libs, and more

§Quick Start

use haystack_client::HaystackClient;

let client = HaystackClient::connect("http://localhost:8080", "user", "pass").await?;
let about = client.about().await?;
let sites = client.read("site", None).await?;
client.close().await;

§Error Handling

All operations return Result<_, ClientError>. See ClientError for the error variants covering authentication, transport, codec, and timeout failures.

Re-exports§

pub use client::HaystackClient;
pub use error::ClientError;

Modules§

auth
Client-side SCRAM SHA-256 authentication handshake.
client
error
Client error types for the Haystack client library.
tls
TLS configuration for mutual TLS (mTLS) client authentication.
transport