Skip to main content

Module guest

Module guest 

Source
Expand description

Guest-side runtime module.

Provides the unified [entry!] macro and platform-specific runtime glue. Actor developers write one entry!(MyActor); the macro selects the correct ABI at compile time based on the target.

§Execution contract

  • One loaded guest instance corresponds to one logical actor instance.
  • The runtime serialises dispatch into the guest instance. Concurrent dispatches within the same instance are forbidden by the host (wasmtime enforces this via &mut Store<HostState>; dynclib hosts enforce via handle ownership).

§Supported platforms

  • WASM Component Model (target_arch = "wasm32", no web feature): wit-bindgen generates the Guest trait + host imports from core/framework/wit/actr-workload.wit; the [entry!] macro produces an adapter that bridges the user’s [Workload] impl into the generated Guest. Targets wasm32-wasip2 and requires wasm-component-ld 0.5.22+ as the linker (see experiments/component-spike-async/REPORT.md).
  • Web ABI / wasm-bindgen (target_arch = "wasm32" + feature = "web"): expands to a wasm_bindgen(start) bootstrap that wraps the user [Workload] in web::WebWorkloadAdapter and hands it to actr_web_abi::host::register_workload. Per Option U γ-unified §4.5 the same user source compiles against both wasm32 ABIs; only the macro expansion differs. Targets wasm32-unknown-unknown.
  • cdylib (feature = "cdylib"): HostVTable function-pointer bridge used for native shared-library guests (iOS / Android).

Modules§

dynclib_abi
DynClib-only C ABI for actr workloads.
vtable
Host callback function table for dynclib guests.