airl-sdk 0.1.0

Typed Rust client for the AIRL HTTP API (create projects, apply patches, typecheck, interpret, compile, query)
Documentation

AIRL SDK - Typed Rust client for the AIRL HTTP API.

Provides a [Client] type wrapping every endpoint exposed by airl-api, with optional Bearer token authentication and structured error types.

Example

use airl_sdk::Client;

let client = Client::new("http://127.0.0.1:9090");

// Create a project from a JSON IR string
let info = client.create_project("my-app", "{...}").unwrap();
println!("project: {} version={}", info.name, info.version);

// Type check
let tc = client.typecheck().unwrap();
assert!(tc.success);

// Interpret
let output = client.interpret_default().unwrap();
print!("{}", output.stdout);

Authentication

If the server is started with serve_with_auth, provide a token:

use airl_sdk::Client;

let client = Client::new("http://127.0.0.1:9090")
    .with_auth_token("my-secret-token");