Proc-macros for the phoxal framework.
Three macro families make up the authoring surface:
- [
phoxal_api_tree!] - declares the dated API-version modules (phoxal_api::y2026_1, …), their version-local body types, theContractBody/ApiVersionimpls, and the api-local topic builders. - [
derive@Api] / [derive@Config] - read anApihandle struct's typed fields (Publisher<T>/Subscriber<T>/Latest<T>/Querier<Req, Resp>/Server<Req, Resp>) and aConfigstruct respectively, and emit the static metadata (ParticipantApi/ParticipantConfig) the runner consumes. - [
macro@service] / [macro@driver] / [macro@simulator] / [macro@tool] - link a participant state struct to itsConfig/Apitypes and record its identity (Participant). - [
macro@behavior] - the bare#[phoxal::behavior]attribute on the inherent impl; it reads#[setup]/#[step(hz = N)]/#[shutdown]plus the query-side#[server]/#[server_snapshot]/#[snapshot]and emits the lifecycle and server dispatch (ParticipantLifecycle).
The struct/impl macros are paired: #[phoxal::service|driver|simulator|tool]
links the participant to its Config/Api types and records the artifact
kind, while #[phoxal::behavior] adds the lifecycle methods and the
server-side contracts, threading Self::Api through every callback (D3).
The participant authoring macros (macro@service / macro@driver /
macro@tool / macro@simulator / macro@behavior) reference the framework
through ::phoxal::…; the engine crate makes that path resolve to itself with
extern crate self as phoxal;. The
phoxal_api_tree! output instead targets the bus ABI floor directly as
::phoxal_bus, since it is invoked in the phoxal-api crate, which does not
depend on the engine.