Documentation

openadr is an implementation of OpenADR 3.1 in Rust: the wire model, a deterministic domain core, a VTN server, a VEN runtime and a typed client, in one crate sliced with Cargo features.

If the protocol itself is new to you, start with What OpenADR is. If you want a VTN running, start with Getting started. If you have one and want to poke at it, the command line. If you are writing the other end, the VEN runtime. If you have a VTN — anyone's — and want to know how much of the specification it actually implements, measuring a VTN. If you are running one where it matters, the security model. And if you are integrating against a VTN built on this crate and need to know where it interprets an ambiguity, read Reading the specification.

For upgrade decisions, see the compatibility contract.

Item-by-item API documentation lives on docs.rs; this site covers what an API listing cannot: why a piece is shaped the way it is, and which of several plausible readings of the specification it implements.

Everything in this section

  • Getting started — A working OpenADR 3.1 stack in one command, then a durable VTN with OAuth2, a programme, a price curve and a VEN reading it.
  • What OpenADR is — What OpenADR 3.1 is and how it works: VTN and VEN, the six objects, targets, intervals and reports, and what changed from OpenADR 2.0b and 3.0.
  • The command line — One binary: run a VTN, and talk to one. Reading, writing and watching any OpenADR 3.1 VTN from a shell, with output that pipes into jq.
  • Running a VTN — Configuration, the endpoint surface, HTTP caching, error bodies, health checks and deployment shapes for an OpenADR 3.1 VTN.
  • Authentication — OAuth2 scopes, the VTN's own token endpoint, JWT validation against a JWKS, pre-shared tokens and anonymous mode — and how to choose between them.
  • Object privacy — How OpenADR 3.1 keeps one VEN from seeing another's dispatch: ownership, target grants, target hiding, and how the rule reaches SQL and the push transports.
  • Security model — The threat model behind an OpenADR 3.1 VTN: what a VEN structurally cannot do, how secrets are held, and the webhook and MQTT attack surfaces.
  • Storage — Choosing between in-memory, SQLite and PostgreSQL for an OpenADR VTN, the schema shape, and the conformance suite that keeps the three interchangeable.
  • Notifications — Webhooks, MQTT topics and the transactional outbox: how a VTN tells a VEN something changed without losing the message or leaking it to the wrong VEN.
  • Finding a local VTN — mDNS/DNS-SD discovery: a VTN on a customer site advertises _openadr3._tcp, and a VEN on the same network finds it without being told a URL.
  • The domain core — Interval expansion, timelines and report scheduling: the deterministic, I/O-free layer that turns OpenADR's declarative timing into absolute windows.
  • The client — A typed OpenADR 3.1 client whose role is a type parameter: token handling, conditional reads, pagination and profile adapters.
  • The VEN runtime — Registration, conditional event sync, a maintained timeline, report scheduling and MQTT push hints — the loop a real VEN runs, with only the meter to write.
  • Embedding and no_std — Using the wire model and domain core without the server, building for a microcontroller or WebAssembly, and the Cargo feature matrix.
  • Measuring a VTN — A black-box conformance suite that runs against any OpenADR 3.1 VTN, cites the clause behind every check, and never counts a skip as a pass.
  • Status — What is built and tested in openadr, what it does not do, and where the specification is ambiguous.
  • Compatibility — How to assess an openadr upgrade for a Rust application, a VEN appliance or a scripted VTN deployment.
  • Reading the specification — Every place the OpenADR 3.1 specification is ambiguous or self-contradictory, what this implementation chose, and why — plus its optional additions.
  • Problem types — Every problem.type this implementation mints, what it means, and what a client should do about it.