Skip to main content

Module v2_2_1

Module v2_2_1 

Source
Available on crate feature v2_2_1 only.
Expand description

The OCPI 2.2.1 wire model, described as a delta from v2_3_0.

OCPI 2.2.1 is still the most widely deployed version, and most of it is byte-identical to 2.3.0. Rather than transcribing the whole specification twice, this module re-exports every type whose wire format is unchanged and defines only what actually differs. A GeoLocation is therefore literally the same Rust type in both versions and needs no conversion; a Price is not, and convert knows how to carry one across.

§What OCPI 2.3.0 changed

Type2.2.12.3.0
types::Price{excl_vat, incl_vat?}{before_taxes, taxes[]}
types::Rolehas HUBHUB removed; hubs use Credentials.hub_party_id
credentials::Credentialsno hub_party_idhub_party_id added
tariffs::Tariffmin/max_price: PricePriceLimit, plus tax_included, preauthorize_amount
locations::Locationparking_places, help_phone added
locations::Evseparking, accepted_service_providers added
locations::Connectorcapabilities added
locations::ConnectorTypeclosed enumOpenEnum, plus MCS, SAE_J3400
locations::ParkingRestriction5 valuesOpenEnum, plus EMPLOYEES, TAXIS, TENANTS
tokens::TokenTypeclosed enumOpenEnum, plus EMAID
paymentsabsentnew module

§Closed enums, decoded leniently

OCPI 2.2.1 has no OpenEnum: by the letter of the specification an unrecognised ConnectorType is a decode error. This crate keeps the value anyway — losing a page of Locations over one unfamiliar plug is worse than the alternative, and OCPI 2.3.0 reclassified exactly these enums as open for the same reason — and reports it through Validate. See ocpi_lenient_enum!.

Spec: https://github.com/ocpi/ocpi, release-2.2.1-bugfixes

Re-exports§

pub use cdrs::Cdr;
pub use credentials::Credentials;
pub use locations::Connector;
pub use locations::Evse;
pub use locations::Location;
pub use sessions::Session;
pub use tariffs::Tariff;
pub use tokens::Token;
pub use types::Price;
pub use types::Role;
pub use versions::Endpoint;
pub use versions::Version;
pub use versions::VersionDetails;

Modules§

cdrs
The CDRs module of OCPI 2.2.1, as a delta from v2_3_0::cdrs.
charging_profiles
The Charging Profiles module of OCPI 2.2.1.
commands
The Commands module of OCPI 2.2.1, as a delta from v2_3_0::commands.
credentials
The Credentials module of OCPI 2.2.1, as a delta from v2_3_0::credentials.
hub_client_info
The Hub Client Info module of OCPI 2.2.1, as a delta from v2_3_0::hub_client_info.
locations
The Locations module of OCPI 2.2.1, as a delta from v2_3_0::locations.
sessions
The Sessions module of OCPI 2.2.1, as a delta from v2_3_0::sessions.
tariffs
The Tariffs module of OCPI 2.2.1, as a delta from v2_3_0::tariffs.
tokens
The Tokens module of OCPI 2.2.1, as a delta from v2_3_0::tokens.
types
The OCPI 2.2.1 spec-wide types that differ from 2.3.0: Price and Role.
versions
The Versions module of OCPI 2.2.1.

Constants§

VERSION
The version number this module implements.