Skip to main content

Guarantees

Mistakes that do not compile, and the error the compiler prints for each.

Mistakes on the left, the error the compiler prints for each on the righta reply typewithout#[derive(Outgoing)]`Receipt` does not declarewhere it is publisheda naming transformon a reply thatnames its destination`Receipt` does not leta transform namethe destinationa mounting withno codec featureenabledno codec is availableto decode thissubscriber's inputOut<impl RequestReply>on a publisherwithout it`MemoryPublisher` does notsupport request / replymessagingworkers(4) andthreads(2) onone subscriberworkers(..) and threads(..)fill the same position:name one of thema publish withno destinationthis publish hasno destination yeta publish withoutthe headers itsmessage declaresthe headers of this publishdo not match the message'scontractYou writeThe compiler answers
The diagram as text
  1. a reply type without #[derive(Outgoing)] → `Receipt` does not declare where it is published
  2. a naming transform on a reply that names its destination → `Receipt` does not let a transform name the destination
  3. a mounting with no codec feature enabled → no codec is available to decode this subscriber's input
  4. Out<impl RequestReply> on a publisher without it → `MemoryPublisher` does not support request / reply messaging
  5. workers(4) and threads(2) on one subscriber → workers(..) and threads(..) fill the same position: name one of them
  6. a publish with no destination → this publish has no destination yet
  7. a publish without the headers its message declares → the headers of this publish do not match the message's contract
  8. You write
  9. The compiler answers

A mistake the compiler can see is a compile error, not a check at startup or on each message. A check per message would cost every delivery, and a check at startup finds the mistake only where the service first runs. Each error names the type or the step at fault.

Each row is a reply, transform, codec, publisher capability, dispatch, publish and typed header rule, in that order. A setting fixed once on a mount chain cannot be fixed again, and a capability the broker lacks is a missing method or an unmet bound.

The lifecycle is typed too: a broker that is not connected has no method to subscribe or publish with, and a closed one has been consumed.