`harmos-macros`
Purpose
Section titled “Purpose”This proc-macro crate contains twenty-two attributes. harmos re-exports them
behind its derive feature — on by default, the way serde ships its derives —
so consumers write #[harmos::…] and never depend on the plumbing crate by
name, and a consumer that turns the feature off writes the same implementations
by hand against the same public traits.
Application Declarations
Section titled “Application Declarations”transaction,record, andstreamstamp one definition with permanent identity. Stream declarations useid, neverslug.transactions,records, andstreamsclose their catalogs.jobanderranddeclare finite work policy.lanescloses the boot-frozen lane set.
Direct Artifact Declarations
Section titled “Direct Artifact Declarations”guestdeclares one Wasm component id, semver, description, and typed configuration.sidecardeclares one native executable id, semver, description, restart policy, and the catalogs naming what it contributes, on its struct. What is typed — the configuration, the error, the resource bundle — is on the author's ownimpl Sidecarand this attribute never reads it.sampler,listener, androutesit over an inherent impl block and are sugar forSampler,Listener, andRoute; a hand-written implementation behaves identically. A sampler declaresinterval_msand nothing else, because the row it answers already declared its stream.samplers,listeners, androutesclose a sidecar's contribution catalogs, one variant per contributed type.requiresadds an artifact id plus semver requirement to a guest or sidecar.invoke,survey,subscribe, andegressdeclare guest capability edges: which transaction, which stream, which record, and how far one endpoint family reaches.
Artifact attributes embed inert declaration fragments in the final executable or component. There is no generated manifest file and no separate contracts tree to keep synchronized.
Design Rules
Section titled “Design Rules”- Attributes add identity, metadata, and dispatch; behavior stays in ordinary Rust code.
- Nothing is pattern-matched off the spelling of a
Result. A row, a reply, and an error are projected through__private::Answerand read by the compiler, so every alias an author already uses keeps working. - Artifact version exists only at guest or sidecar level.
- Dependencies never name routes.
- Historical application definitions point directly to their current family root.
- Generated paths name
harmos, keeping the proc-macro crate out of consumer vocabulary.