Skip to main content

CemEvent

Enum CemEvent 

Source
#[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(InstructionStatusUpdate), 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Negotiated

A protocol version was agreed.

Fields

§version: ProtocolVersion

The version string that was chosen.

§profile: WireProfile

The 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: ControlType

What is active.

§

Deselected

The control type was deactivated.

§

Description

The resource published a description or a constraint.

Fields

§kind: MessageKind

Which message.

§message: Message

The message.

§

Status

The resource reported a status.

Fields

§kind: MessageKind

Which message.

§message: Message

The message.

§

Measurement(Box<PowerMeasurement>)

A measurement arrived.

§

Forecast(Box<PowerForecast>)

A forecast arrived.

§

InstructionStatus(InstructionStatusUpdate)

What became of an instruction this manager sent.

The whole update, not just the status: timestamp is “when status_type has changed the last time”, which is not when the message arrived, and a manager reconciling a late SUCCEEDED against its own dispatch log needs the difference.

§

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

§actuator: Option<Id>

The actuator it belongs to, where the control type has actuators.

§timer: Id

Which timer.

§finished_at: Timestamp

When it finishes. In the past means it is not blocking — which is not quite the same as saying it ever ran.

§

DescriptionActivated

A description that was published for the future is now in force.

Fields

§kind: MessageKind

Which message became effective.

§

Revoked

The resource withdrew an object.

Fields

§object_type: RevokableObjects

What kind.

§object_id: Id

Which one.

§

Acked(MessageHandle)

Something we sent was accepted.

§

Nacked

Something we sent was refused.

Fields

§handle: MessageHandle

What was refused.

§diagnostic: Option<String>

What the peer said.

§consequence: Consequence

What the standard says to do about it.

§

AckTimedOut(MessageHandle)

Nothing came back in time.

§

UnmatchedAck

An acknowledgement arrived for something we never sent.

Fields

§subject: Id

What it was about.

§status: ReceptionStatusValues

How it was answered.

§

SessionRequested

The resource asked to end or restart the session.

Fields

§request: SessionRequestType

Reconnect or terminate.

§diagnostic: Option<String>

What it said about it.

§

Refused

An inbound message was refused.

Fields

§kind: Option<MessageKind>

What it claimed to be.

§status: ReceptionStatusValues

How it was refused.

§report: Report

Everything wrong with it.

§

Warnings

An inbound message was accepted but is suspect.

Fields

§kind: MessageKind

What it was.

§report: Report

What is suspect about it.

§

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.

Fields

§kind: MessageKind

What was sent.

§report: Report

What this side’s own validator said about it.

§

Closed

The session ended.

Fields

§reason: CloseReason

Why.

§reconnect_after: Option<Duration>

How long to wait before reconnecting, if reconnecting makes sense.

Trait Implementations§

Source§

impl Clone for CemEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CemEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CemEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CemEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more