Saltar al contenido principal

Rust SDK — zeq

A tokio-native, serde-JSON Rust client. Zero unsafe. Same wire format as every other SDK — receipts from a Rust call round-trip byte-for-byte against the TypeScript, Python, Go, JavaScript, and HTTP forms.

Install

# Cargo.toml
[dependencies]
zeq = "1.287"
tokio = { version = "1", features = ["full"] }

First call — public, no key

use zeq::pulse;

#[tokio::main]
async fn main() -> Result<(), zeq::Error> {
let p = pulse().await?;
println!("Zeqond {} · phase {:.3} · R(t) {}",
p.zeqond, p.phase, p.r_t);
Ok(())
}

pulse() hits GET /api/zeq/pulse. No authentication, sub-30 ms response, ideal for embedded telemetry running on the 1.287 Hz system clock.

Authed call — zeq.compute()

use zeq::{ZeqClient, Compute};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), zeq::Error> {
let zeq = ZeqClient::from_env()?; // reads $ZEQ_KEY

let r = zeq.compute(Compute {
operators: vec!["KO42".into(), "QM5".into(), "GR40".into()],
domain: Some("cross".into()),
inputs: json!({ "t": 0 }),
}).await?;

println!("{} {} ± {}", r.value, r.unit, r.uncertainty);
println!("zeqProof: {}", r.zeq_proof);
println!("compliance: {:?}", r.compliance.standards_aligned);
Ok(())
}

Every response carries the same ZeqState + ZeqProof + ZeqCompliance v1 envelope as every other SDK.

Why Rust here

  • Embedded firmware. The no_std feature flag drops the runtime, so the same crate compiles for ARM Cortex-M targets that run alongside the Embedded C observer agent.
  • Aerospace flight software. serde-driven JSON means strict parse errors at compile time — DO-178C tool-qualification audits get the same trace boolean as every other path.
  • Server-side throughput. Async by default. One client handles thousands of in-flight compute calls.

Compose with

Source