> ## Documentation Index
> Fetch the complete documentation index at: https://eddy-ac74d702.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust

> eddy-client = "0.1.0"

```toml theme={null}
[dependencies]
eddy-client = "0.1.0"
```

Blocking (`ureq`), `serde` models, no async runtime required. Generated by the same emitter as the Python and TypeScript packages.

## The smallest complete solve

```rust theme={null}
use eddy_client::{Eddy, models::SolveRequest};

let eddy = Eddy::new("http://127.0.0.1:8080");   // EDDY_BASE_URL / EDDY_API_KEY when empty
let body: SolveRequest = serde_json::from_value(serde_json::json!({
    "geometry": { "primitive": { "box": { "lx": 1.0, "ly": 0.2, "lz": 0.2 } } },
    "material": { "id": "steel", "e": 210e9, "nu": 0.3, "rho": 7850, "yield": 250e6 },
    "loads": [{ "region": "x_max", "force": [0, 0, -1000] }],
    "constraints": [{ "region": "x_min", "fixed": "all" }],
    "mesh_opts": { "element_size": 0.1 }
}))?;
let result = eddy.solve_structural(&body)?;
println!("{:?} cached={:?} {:?}", result.result_id, result.cached, result.metrics);
let doc = serde_json::to_value(&result)?;
let u = eddy.field(&doc, Some("displacement"))?;   // Field { components: 3, count, values }
println!("{} nodes, max |u| = {}", u.count, u.max_magnitude());
```

## Errors

Every failure is an `EddyError { code, message, status, retry_after }` — the API's error code and the HTTP status (`0` for a client-side `TRANSPORT` / `TIMEOUT` / `DECODE`); `retry_after` the seconds a `429` / `503` asked for once the retries are spent (a `429` is retried only when it carries `retry-after`).

## Async jobs

A `202` is followed through `poll` to the result by default; `Eddy::new(..).wait_jobs(false)` returns the handle instead (its `job_id` in the model's `extra`), then `eddy.wait_for_job(id)`, `eddy.job_events(id)` (the server-sent events, collected) or `eddy.job_events_iter(id)` (an iterator handing each event out as the engine sends it — `for ev in eddy.job_events_iter(&id)? { let (event, status) = ev?; }`). A `webhook: Some(WebhookSpec { url, secret })` on the body has the engine POST the finished job record, signed (`x-eddy-signature: blake3=<hex>`); `eddy.usage()` is the caller's own meter. The conventions for one key per tenant are on the [tenancy page](https://eddy-ac74d702.mintlify.site/sdks/tenancy.md).

## Blobs and fields

`eddy.blob(id)` fetches bytes through a `BlobCache` (`EDDY_CACHE_DIR`, default `~/.cache/eddy-solve/blobs`; `.cache(None)` disables it — a blob id names its bytes forever). `eddy.field(&result_json, Some("displacement"))` decodes an `SSFLD1` blob into `Field { components, count, values }`; `eddy.fields(&result_json)` decodes them all.

## Reference

One method per operation, named `snake_case` of the operation id — the [API reference](https://eddy-ac74d702.mintlify.site/api-reference) names each. Path parameters are `&str`, a JSON body is `&Model` (every field `Option`, undocumented keys in `extra`), query parameters `Option<T>`; the reply is the documented model, `serde_json::Value`, `String` or `Vec<u8>` by its content type. `request(method, path, RequestOptions)` is the untyped escape hatch the typed methods share.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.