Skip to main content

Module model

Module model 

Source
Expand description

The OpenADR 3.1 wire model.

Types here mirror the Alliance’s OpenAPI document, with three deliberate departures:

  1. Invariants are parsed, not checked later. Identifiers, payload types and durations are newtypes that cannot hold an illegal value (ids, time, values).
  2. Sentinels are lifted into the type system. P9999Y and 0001-01-01 become Duration::Forever and StartTime::Now instead of lurking inside a timestamp.
  3. Request and response bodies are distinct types. A client cannot name id or createdDateTime in a POST, because those fields do not exist on the request type.

Everything is no_std + alloc compatible.

Where the specification is ambiguous and this model had to choose, the choice is recorded at https://hupe1980.github.io/openadr/docs/spec-notes/.

Re-exports§

pub use auth::AuthServerInfo;
pub use auth::ClientCredentialRequest;
pub use auth::ClientCredentialResponse;
pub use auth::OAuthError;
pub use auth::OAuthErrorKind;
pub use ids::ClientId;
pub use ids::ClientName;
pub use ids::IdentifierError;
pub use ids::ObjectId;
pub use ids::ProgramName;
pub use ids::ResourceName;
pub use ids::Target;
pub use ids::VenName;
pub use notification::Notification;
pub use notifier::MqttAuthentication;
pub use notifier::MqttNotifierBinding;
pub use notifier::NotifierTopics;
pub use notifier::NotifiersResponse;
pub use notifier::Serialization;
pub use notifier::TopicsResponse;
pub use objects::BlResourceRequest;
pub use objects::BlVenRequest;
pub use objects::Event;
pub use objects::EventPayloadDescriptor;
pub use objects::EventRequest;
pub use objects::Interval;
pub use objects::IntervalPeriod;
pub use objects::ObjectMetadata;
pub use objects::ObjectOperation;
pub use objects::ObjectType;
pub use objects::Operation;
pub use objects::PayloadDescriptor;
pub use objects::Priority;
pub use objects::Program;
pub use objects::ProgramDescription;
pub use objects::ProgramRequest;
pub use objects::Report;
pub use objects::ReportDescriptor;
pub use objects::ReportIntervals;
pub use objects::ReportPayloadDescriptor;
pub use objects::ReportRequest;
pub use objects::ReportResource;
pub use objects::Resource;
pub use objects::ResourceRequest;
pub use objects::Subscription;
pub use objects::SubscriptionRequest;
pub use objects::UnknownObjectType;
pub use objects::Ven;
pub use objects::VenRequest;
pub use objects::VenResourceRequest;
pub use objects::VenVenRequest;
pub use problem::Problem;
pub use time::Duration;
pub use time::SCHEMA_DURATION_PATTERN;
pub use time::StartTime;
pub use time::TimeError;
pub use time::Timestamp;
pub use values::PayloadType;
pub use values::Point;
pub use values::ReadingType;
pub use values::Unit;
pub use values::Value;
pub use values::ValuesMap;

Modules§

adapt
Wire adapters: making non-conformant peers parseable without weakening the model.
auth
OAuth 2.0 client-credentials types and token-endpoint discovery.
ids
Constrained string newtypes.
notification
The notification body a VTN pushes to subscribers.
notifier
Notifier discovery: GET /notifiers and the MQTT topic endpoints.
objects
The six addressable objects, their request bodies, and the pieces they share.
problem
RFC 9457 / Zalando-style problem objects.
time
Time, durations, and the two magic values the specification hides inside them.
values
Payload values: valuesMap, point, units, and the numeric policy.

Constants§

MAX_PAGE_LIMIT
The page size the schema caps limit at [API /programs limit].