#[non_exhaustive]pub enum Version {
V1_6,
V2_0_1,
V2_1,
}Expand description
A supported OCPP version.
The ordering is oldest → newest, so max() picks the most capable version.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V1_6
OCPP 1.6J (edition 2 + errata, plus the Security Whitepaper edition 2 extensions).
V2_0_1
OCPP 2.0.1.
V2_1
OCPP 2.1.
Implementations§
Source§impl Version
impl Version
Sourcepub const fn subprotocol(self) -> &'static str
pub const fn subprotocol(self) -> &'static str
The WebSocket subprotocol token, e.g. ocpp2.1 (Part 4 §3.1.2).
Sourcepub const fn slug(self) -> &'static str
pub const fn slug(self) -> &'static str
A short, filesystem-safe identifier: v1_6, v2_0_1, v2_1.
Used for schema directories, metric labels and log fields.
Sourcepub fn from_subprotocol(token: &str) -> Option<Self>
pub fn from_subprotocol(token: &str) -> Option<Self>
Parses a WebSocket subprotocol token.
Sourcepub const fn has_extended_message_types(self) -> bool
pub const fn has_extended_message_types(self) -> bool
Whether this version has CALLRESULTERROR (5) and SEND (6).
Sourcepub const fn has_rpc_framework_error(self) -> bool
pub const fn has_rpc_framework_error(self) -> bool
Whether this version defines the RpcFrameworkError error code.
1.6J does not; framing failures are reported as GenericError there.
Sourcepub const fn uses_unreadable_message_id(self) -> bool
pub const fn uses_unreadable_message_id(self) -> bool
Whether an unreadable MessageId must be answered with the literal id "-1"
(2.x Part 4 §4.1.1). 1.6J has no such rule.
Sourcepub const fn strict_synchronicity(self) -> bool
pub const fn strict_synchronicity(self) -> bool
Whether the one-outstanding-CALL rule is a SHALL NOT (2.x, Part 4 §4.1.1) rather
than 1.6J’s SHOULD NOT.
Sourcepub const fn supports_compression(self) -> bool
pub const fn supports_compression(self) -> bool
Whether RFC 7692 permessage-deflate is part of the specification.
2.1 Part 4 §3.4 Table 2: the CSMS and a Local Controller SHALL support it; a Charging Station MAY. 1.6J §5.1 recommends no compression, and 2.0.1 is silent.