Skip to main content

Module core

Module core 

Source
Expand description

The domain core: deterministic, I/O-free, and shared by the VTN, the VEN and the tests.

Four things live here, and they are the parts of OpenADR that carry real semantics rather than transport: IntervalExpander resolves an event’s declared timing into absolute windows, Timeline merges concurrent events by priority, Access decides object privacy, and ReportSchedule says when a VEN owes a report.

Everything takes its time from an injected Clock, so a scenario that fails in production can be replayed exactly in a test and nothing here needs to sleep. That, and having no I/O, is what makes the layer no_std-capable.

Guide: https://hupe1980.github.io/openadr/docs/domain-core/.

Re-exports§

pub use interval::ExpandError;
pub use interval::ExpandedInterval;
pub use interval::IntervalExpander;
pub use interval::IntervalSequence;
pub use interval::active_window;
pub use privacy::Access;
pub use privacy::Grant;
pub use privacy::GrantIndex;
pub use privacy::OwnerFilter;
pub use privacy::Role;
pub use privacy::TargetFilter;
pub use report::ReportDue;
pub use report::ReportSchedule;
pub use report::ScheduleOptions;
pub use timeline::Segment;
pub use timeline::Timeline;

Modules§

interval
Turning an event’s declared intervals into absolute time windows.
privacy
Object privacy.
report
When a VEN must produce a report, and which intervals it must cover.
timeline
Resolving overlapping events into one schedule.

Structs§

FixedClock
A clock frozen at one instant.
SystemClockstd
Reads the host clock.

Traits§

Clock
A source of the current time.