1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Component Model bindings for the `actr:workload@0.1.0` WIT contract.
//!
//! Phase 1, Commit 2: these bindings now back the single path the wasm
//! workload runtime takes — the legacy handwritten ptr/len ABI
//! (core/hyper/src/wasm/abi.rs, core/framework/src/guest/dynclib_abi.rs,
//! entry!-generated `actr_init` / `actr_handle` / `actr_alloc` / `actr_free`)
//! is replaced by the Component Model canonical ABI.
//!
//! # Async shape
//!
//! Host-side imports are generated as `async fn` via
//! `imports: { default: async | trappable }` and guest exports as `async
//! fn` via `exports: { default: async }`. The underlying WIT is plain
//! sync `func` — this is the Phase 0.5-validated combination that keeps
//! actr's single-threaded-actor invariant while still driving real I/O
//! through tokio.
//!
//! # Why `async | trappable`
//!
//! `async` makes every import an `async fn`; `trappable` lets host
//! implementations return a `Result<T, wasmtime::Error>` so that
//! host-side failures (e.g. a downstream RPC timeout) cleanly surface as
//! `Result` rather than forcing a `Trap`. The generated return shape is
//! `wasmtime::Result<Result<T, actr-error>>`: the outer `Result` signals
//! trap-level failure, the inner `Result` is the WIT variant return.
//!
//! # Why no `with` map
//!
//! Generated Rust types mirroring the WIT records live in this module's
//! `actr::workload::types` namespace. The host translates at the
//! boundary (inside the `Host` impl) rather than remapping to
//! actr_protocol / actr_framework types via `with: { ... }`: boundary
//! translation keeps the generated bindings self-contained and makes the
//! mapping rules reviewable in `host.rs`.
bindgen!;