phoxal-macros 0.42.2

Proc-macros for the phoxal framework: phoxal_api_tree!, #[derive(Service)], #[derive(Driver)], #[phoxal::behavior].
Documentation

Proc-macros for the phoxal framework.

Three macro families make up the authoring surface:

  • [phoxal_api_tree!] - declares concrete API-revision modules (phoxal_api::v0_1, …), their revision-local body types, the ContractBody/ApiVersion impls, and the api-local topic builders.
  • [derive@Api] / [derive@Config] - read an Api handle struct's typed fields (the role-gated publishers / Subscriber<T> / Latest<T> / Querier<Req, Resp> / Server<Req, Resp>) and a Config struct 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 its Config/Api types 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.