Skip to content

`harmos-macros`

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.

  • transaction, record, and stream stamp one definition with permanent identity. Stream declarations use id, never slug.
  • transactions, records, and streams close their catalogs.
  • job and errand declare finite work policy.
  • lanes closes the boot-frozen lane set.
  • guest declares one Wasm component id, semver, description, and typed configuration.
  • sidecar declares 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 own impl Sidecar and this attribute never reads it.
  • sampler, listener, and route sit over an inherent impl block and are sugar for Sampler, Listener, and Route; a hand-written implementation behaves identically. A sampler declares interval_ms and nothing else, because the row it answers already declared its stream.
  • samplers, listeners, and routes close a sidecar's contribution catalogs, one variant per contributed type.
  • requires adds an artifact id plus semver requirement to a guest or sidecar.
  • invoke, survey, subscribe, and egress declare 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.

  • 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::Answer and 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.
Stokker Technologies markDesigned and built by Stokker Technologies