Skip to main content

Crate airl_sdk

Crate airl_sdk 

Source
Expand description

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");

Structs§

Client
Typed client for the AIRL HTTP API.
CompileResponse
Response from Client::compile.
ConstraintsResponse
Response from Client::check_constraints.
DiagnosticResponse
One entry from the type checker output.
InterpretLimits
Execution limits for Client::interpret.
InterpretResponse
Response from Client::interpret.
ModuleResponse
Result of Client::get_module: the current module plus its version.
PatchPreviewResponse
Response from Client::preview_patch.
PatchResultResponse
Response from Client::apply_patch or Client::undo_patch.
ProjectInfo
Summary information about a loaded project.
TextProjectionResponse
Response from Client::project_to_text.
TypeCheckResponse
Response from Client::typecheck.

Enums§

ProjectionLang
Language for Client::project_to_text.
SdkError
Errors returned by the AIRL SDK client.