Skip to main content

Module types

Module types 

Source
Expand description

The S2 JSON data model: 36 messages and 41 component types.

Types common to every control type are in common; the rest are grouped by the control type they belong to (pebc, ppbc, ombc, frbc, ddbc). The scalar types the whole model rests on — Id, Timestamp, Duration — are re-exported here.

The model is wire-faithful, warts included: DDBC.OperationMode really does capitalise its Id field, DDBC.ActuatorDescription really does spell it supported_commodites, and ControlType really does say NOT_CONTROLABLE. Each is carried by a #[serde(rename)] so the bytes are right while the Rust identifier is not also wrong, and each is listed as errata.

What the types do not do is judge. A factor of 1.3 and a 289-element forecast are both representable, because a proxy has to be able to carry a message it would refuse to send, and because INVALID_CONTENT is a reception status the standard wants sent — which requires having decoded the message first. crate::validate is what judges; the builders are what refuse.

Re-exports§

pub use id::Id;
pub use id::InvalidId;
pub use time::Duration;
pub use time::InvalidTimestamp;
pub use time::TimeOutOfRange;
pub use time::Timestamp;
pub use common::*;

Modules§

common
Types common to every control type, and the ten messages that are not part of one.
ddbc
Demand Driven Based Control — a device that must meet a demand but is flexible in how it meets it.
frbc
Fill Rate Based Control — anything that stores or buffers energy.
id
Id — the S2 identifier type.
ombc
Operation Mode Based Control — a device that can adjust its power, with no constraint on how long the adjustment lasts.
pebc
Power Envelope Based Control — a device that cannot be driven, only bounded.
ppbc
Power Profile Based Control — a task that must be done, but not necessarily now.
time
Timestamp and Duration — the two time types on the S2 wire.

Structs§

ProtocolVersion
An S2 JSON version string as it appears on the wire.

Enums§

WireProfile
A shape of the S2 JSON wire.