Expand description
The OpenADR 3.1 wire model.
Types here mirror the Alliance’s OpenAPI document, with three deliberate departures:
- Invariants are parsed, not checked later. Identifiers, payload types and durations are
newtypes that cannot hold an illegal value (
ids,time,values). - Sentinels are lifted into the type system.
P9999Yand0001-01-01becomeDuration::ForeverandStartTime::Nowinstead of lurking inside a timestamp. - Request and response bodies are distinct types. A client cannot name
idorcreatedDateTimein aPOST, 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::FiniteDuration;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 /notifiersand 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
- RFC 3339 timestamps and ISO 8601 durations for OpenADR schedules.
- values
- Payload values:
valuesMap,point, units, and the numeric policy.
Structs§
- Decimal
- The exact decimal
Value::NumberandPointhold, re-exported so a payload needs norust_decimaldependency of its own.Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.
Constants§
- MAX_
PAGE_ LIMIT - The page size the schema caps
limitat[API /programs limit].