#[non_exhaustive]pub enum ModuleId {
Show 14 variants
Cdrs,
ChargingProfiles,
Commands,
Credentials,
HubClientInfo,
Locations,
Payments,
Sessions,
Tariffs,
Tokens,
Versions,
Booking,
InvoiceReconciliation,
Custom(String),
}Expand description
The identifier of an OCPI module, as used in Endpoint.identifier.
Parties are allowed to create custom modules or customized versions of the existing modules. To do so, the ModuleID enum can be extended with additional custom moduleIDs. … It is advised to use a prefix (e.g. country-code + party-id) for any custom moduleID.
So ModuleId::Custom("nltnm-tokens") is a legitimate value, not an error.
Spec: 2.3.0 §version_information_endpoint_moduleid_enum
This is an OCPI OpenEnum: a value this version of the specification does not
define is a legitimate extension, and Validate does
not report it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cdrs
Charge Detail Records. Sender: CPO.
Wire value: cdrs
ChargingProfiles
Smart charging profiles.
Wire value: chargingprofiles
Commands
Remote commands: start, stop, reserve, unlock.
Wire value: commands
Credentials
Credentials and registration. Required for all implementations.
Wire value: credentials
HubClientInfo
Hub client info: which parties a hub has connected.
Wire value: hubclientinfo
Locations
Charging locations, EVSEs and connectors. Sender: CPO.
Wire value: locations
Payments
Payment terminals and financial advice confirmations. Sender: PTP.
Added to the protocol in OCPI 2.3.0.
Spec erratum. The Payments module chapter gives “Module Identifier: payments”,
but the module is missing from the ModuleID table in
§version_information_endpoint_moduleid_enum of the same release. The chapter is
normative for its own identifier, so payments is treated as a known module here.
Wire value: payments
Sessions
Charging sessions. Sender: CPO.
Wire value: sessions
Tariffs
Tariffs. Sender: CPO.
Wire value: tariffs
Tokens
Driver tokens and real-time authorization. Sender: eMSP.
Wire value: tokens
Versions
Versions and version details. Every implementation has this, but it is not listed as an endpoint inside version details.
Wire value: versions
Booking
Bookings, from the OCPI 2.3.0 bookings release branch.
Spec quirk. The identifier really is Booking: singular, and the only module ID
in OCPI that is not lower-case. Every other module uses a lower-case plural. It is
also absent from that branch’s ModuleID table. Peers that guessed bookings
exist; see ModuleId::matches.
Wire value: Booking
InvoiceReconciliation
Invoice reconciliation, from the OCPI 2.3.0 payments release branch.
Wire value: invoicereconciliation
Custom(String)
A value this version of the specification does not define, preserved verbatim.
The variant is named Custom rather than Other because several OCPI OpenEnums
have a defined value that is literally OTHER.
Implementations§
Source§impl ModuleId
impl ModuleId
Sourcepub const ALL_KNOWN: &'static [Self]
pub const ALL_KNOWN: &'static [Self]
Every value this version of the specification defines, in declaration order.
Sourcepub const ALL_KNOWN_WIRE: &'static [&'static str]
pub const ALL_KNOWN_WIRE: &'static [&'static str]
Every wire value this version of the specification defines.
Sourcepub fn from_str_ignore_case(s: &str) -> Self
pub fn from_str_ignore_case(s: &str) -> Self
Parses a wire value, ignoring ASCII case for the known values.
For peers that get the case wrong; FromStr is strict.
Source§impl ModuleId
impl ModuleId
Sourcepub const fn is_functional(&self) -> bool
pub const fn is_functional(&self) -> bool
Whether this module carries the message routing headers.
Only requests/responses from Function Modules … SHALL be routed, so need the routing headers. The requests/responses to/from Configuration Modules: Credentials, Versions and Hub Client Info are not to be routed … Thus routing headers SHALL NOT be used with these modules.
A custom module is assumed to be functional, since that is what a party would define one for.
Spec: 2.3.0 §transport_and_format_message_routing
Sourcepub const fn is_configuration(&self) -> bool
pub const fn is_configuration(&self) -> bool
Whether this is one of the three configuration modules, which are never routed.
Spec: 2.3.0 §transport_and_format_message_routing
Sourcepub fn matches(&self, other: &Self) -> bool
pub fn matches(&self, other: &Self) -> bool
Compares module identifiers the way a tolerant peer would.
Two accommodations, both narrow and both deliberate:
- ASCII case is ignored. Module identifiers are lower-case everywhere except
Booking, so a peer that lower-cased the lot is still understood. Bookingandbookingsare treated as the same module. The Bookings chapter gives “Module Identifier:Booking” — singular, and the only mixed-case identifier in OCPI — while implementations that assumed the lower-case plural exist. Getting this wrong means silently not discovering the module, which is worse than accepting both.
Use this when reading a peer’s version details; use == when the exact value matters.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Whether this build of ocpi-kit has a wire model for this module.
Sourcepub fn exists_in(&self, version: &VersionNumber) -> bool
pub fn exists_in(&self, version: &VersionNumber) -> bool
Whether the module exists in version.
Spec: 2.2.1 and 2.3.0 §version_information_endpoint_moduleid_enum; 2.1.1
§version_information_endpoint (which has neither hubclientinfo nor chargingprofiles).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModuleId
impl<'de> Deserialize<'de> for ModuleId
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for ModuleId
Source§impl JsonSchema for ModuleId
Available on crate feature schema only.
impl JsonSchema for ModuleId
schema only.Source§fn json_schema(_g: &mut SchemaGenerator) -> Schema
fn json_schema(_g: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for ModuleId
impl Ord for ModuleId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for ModuleId
impl PartialOrd for ModuleId
Auto Trait Implementations§
impl Freeze for ModuleId
impl RefUnwindSafe for ModuleId
impl Send for ModuleId
impl Sync for ModuleId
impl Unpin for ModuleId
impl UnsafeUnpin for ModuleId
impl UnwindSafe for ModuleId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.