#[non_exhaustive]pub enum CemEvent {
Show 21 variants
Negotiated {
version: ProtocolVersion,
profile: WireProfile,
},
ResourceDescribed(Box<ResourceManagerDetails>),
Ready {
control_type: ControlType,
},
Deselected,
Description {
kind: MessageKind,
message: Message,
},
Status {
kind: MessageKind,
message: Message,
},
Measurement(Box<PowerMeasurement>),
Forecast(Box<PowerForecast>),
InstructionStatus {
instruction_id: Id,
status: InstructionStatus,
},
TimerReported {
actuator: Option<Id>,
timer: Id,
finished_at: Timestamp,
},
DescriptionActivated {
kind: MessageKind,
},
Revoked {
object_type: RevokableObjects,
object_id: Id,
},
Acked(MessageHandle),
Nacked {
handle: MessageHandle,
status: ReceptionStatusValues,
diagnostic: Option<String>,
consequence: Consequence,
},
AckTimedOut(MessageHandle),
UnmatchedAck {
subject: Id,
status: ReceptionStatusValues,
},
SessionRequested {
request: SessionRequestType,
diagnostic: Option<String>,
},
Refused {
kind: Option<MessageKind>,
status: ReceptionStatusValues,
report: Report,
},
Warnings {
kind: MessageKind,
report: Report,
},
OutboundWarnings {
kind: MessageKind,
report: Report,
},
Closed {
reason: CloseReason,
reconnect_after: Option<Duration>,
},
}Expand description
Something a Customer Energy Manager’s application needs to know about.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Negotiated
A protocol version was agreed.
Fields
version: ProtocolVersionThe version string that was chosen.
profile: WireProfileThe wire shape it selects.
ResourceDescribed(Box<ResourceManagerDetails>)
The resource described itself. Now a control type can be selected.
Ready
The control type this manager selected is active.
Fields
control_type: ControlTypeWhat is active.
Deselected
The control type was deactivated.
Description
The resource published a description or a constraint.
Status
The resource reported a status.
Measurement(Box<PowerMeasurement>)
A measurement arrived.
Forecast(Box<PowerForecast>)
A forecast arrived.
InstructionStatus
What became of an instruction this manager sent.
TimerReported
The resource reported on a timer.
Reported, not finished: S2J messages/*.TimerStatus.finished_at says that “if
the timer was never started, the value can be an arbitrary DateTimeStamp in the
past”, so a past instant means the timer ran out or never ran, and a manager
choosing a transition cares which. The supported reading is narrower — a
finished_at in the future blocks, everything else does not — and is the one
model::blocking_timers uses.
Fields
DescriptionActivated
A description that was published for the future is now in force.
Fields
kind: MessageKindWhich message became effective.
Revoked
The resource withdrew an object.
Acked(MessageHandle)
Something we sent was accepted.
Nacked
Something we sent was refused.
Fields
handle: MessageHandleWhat was refused.
status: ReceptionStatusValuesHow.
consequence: ConsequenceWhat the standard says to do about it.
AckTimedOut(MessageHandle)
Nothing came back in time.
UnmatchedAck
An acknowledgement arrived for something we never sent.
SessionRequested
The resource asked to end or restart the session.
Fields
request: SessionRequestTypeReconnect or terminate.
Refused
An inbound message was refused.
Fields
kind: Option<MessageKind>What it claimed to be.
status: ReceptionStatusValuesHow it was refused.
Warnings
An inbound message was accepted but is suspect.
OutboundWarnings
A message this side sent had warnings of its own.
validate_outbound refuses an outbound message with an error at the call site;
this is what it has to say about the rest. A resource publishing a description
s2-python will refuse (S2-ACT-001), or a manager instructing a transition its
own picture of the timers says is blocked (S2-INST-005), learns it here rather
than from a peer. Separate from Warnings because the two mean
opposite things: one is a peer worth watching, the other is this side.
Closed
The session ended.
Fields
reason: CloseReasonWhy.