Rust SDK
The Rust SDK provides HulyaSync for high-performance temporal synchronization and compiles to WebAssembly for browser deployment. For full operator computation, use the REST API.
Installation
# Cargo.toml
[dependencies]
zeq-os = { path = "sdk/rust" }
Or build locally:
cd sdk/rust && cargo build --release
How it works
The Rust SDK has two modes:
- Local —
HulyaSyncruns entirely in your process. No server needed. No auth. - API —
ZeqSDKwraps REST calls to the Zeq OS compute service. Requires auth.
Authentication
use std::collections::HashMap;
let base = "http://localhost";
// Register
let client = reqwest::blocking::Client::new();
let resp: HashMap<String, String> = client
.post(format!("{base}/api/users/register"))
.json(&serde_json::json!({ "displayName": "Alice", "equation": "x^2 + sin(y*pi) + phi" }))
.send()?.json()?;
let token = &resp["token"];
// Login
let resp: HashMap<String, String> = client
.post(format!("{base}/api/users/login"))
.json(&serde_json::json!({ "equation": "x^2 + sin(y*pi) + phi" }))
.send()?.json()?;
let token = &resp["token"];
Quick Start
use zeq_os::HulyaSync;
fn main() {
// ── Local temporal sync (no auth, no server) ──────────────────────────
let sync = HulyaSync::new();
let zeqond = sync.get_zeqond();
let phase = sync.current_phase();
println!("Zeqond: {zeqond} Phase: {phase:.4}");
// Zeq Equation modulation: R(t) = S(t) × [1 + α·sin(2πft)]
let g_modulated = sync.modulate(9.80665);
println!("g modulated: {g_modulated:.6}");
// KO42 Metric Tensioner (mandatory in every computation)
println!("KO42 = {:.6}", sync.ko42_automatic());
println!("{}", sync.daemon_tick());
// ── Browse operators via API (no auth — equations are public) ──────────
let ops: serde_json::Value = reqwest::blocking::get("http://localhost/api/zeq/operators")
.unwrap().json().unwrap();
for op in ops["operators"].as_array().unwrap().iter().take(3) {
println!("{:6} {:30} {}", op["id"], op["name"], op["equation"]);
}
// ── Execute operator via API (requires account) ────────────────────────
let client = reqwest::blocking::Client::new();
let result: serde_json::Value = client
.post("http://localhost/api/zeq/operators/execute?operator=NM21")
.bearer_auth("your-jwt-token")
.json(&serde_json::json!({ "params": { "G": 6.674e-11, "m1": 5.97e24, "m2": 7.35e22, "r": 3.84e8 } }))
.send().unwrap().json().unwrap();
println!("F = {} N", result["value"]);
// ── 7-Step Wizard via API (requires account) ───────────────────────────
let state: serde_json::Value = client
.post("http://localhost/api/7step/run")
.bearer_auth("your-jwt-token")
.json(&serde_json::json!({ "query": "gravitational time dilation near Earth", "operators": ["KO42", "GR37"], "mode": "basic" }))
.send().unwrap().json().unwrap();
println!("Operators: {}", state["selected_operators"]);
println!("Master sum: {}", state["master_sum"]);
}
HulyaSync API
pub struct HulyaSync { /* ... */ }
impl HulyaSync {
pub fn new() -> Self;
pub fn current_phase(&self) -> f64; // [0, 2π) phase
pub fn get_zeqond(&self) -> u64; // Zeqonds since Unix epoch
pub fn modulate(&self, value: f64) -> f64; // R(t) = S(t)[1 + α·sin(2πft)]
pub fn ko42_automatic(&self) -> f64; // α · sin(2π × 1.287 × t)
pub fn daemon_tick(&self) -> String; // Daemon announcement
}
pub const HULYA_FREQUENCY: f64 = 1.287; // Hz
pub const ZEQOND_MS: u64 = 777; // milliseconds
pub const ALPHA: f64 = 0.00129; // modulation depth
WebAssembly Target
The Rust SDK compiles to WASM for browser use — see the WebAssembly page.
cargo install wasm-pack
cd sdk/rust && wasm-pack build --target web
Framework Equations
Zeq Equation: R(t) = S(t) × [1 + 0.00129 × sin(2π × 1.287 × t)]
KO42 Automatic: α × sin(2π × 1.287 × t)
HULYAS: □(φ) − μ²(r)φ − λφ³ − exp(−φ/φ_c) + φ₄₂ × Σ(Cₖ(φ)) = T^μ_μ + βF·F + J_ext
Architecture
sdk/rust/
├── Cargo.toml
└── src/
├── lib.rs
└── core/
├── sync.rs # HulyaSync — local temporal engine
├── constants.rs # Physical constants
└── state.rs # ZeqState data structure