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
| Type | 2.2.1 | 2.3.0 |
|---|---|---|
types::Price | {excl_vat, incl_vat?} | {before_taxes, taxes[]} |
types::Role | has HUB | HUB removed; hubs use Credentials.hub_party_id |
credentials::Credentials | no hub_party_id | hub_party_id added |
tariffs::Tariff | min/max_price: Price | PriceLimit, plus tax_included, preauthorize_amount |
locations::Location | — | parking_places, help_phone added |
locations::Evse | — | parking, accepted_service_providers added |
locations::Connector | — | capabilities added |
locations::ConnectorType | closed enum | OpenEnum, plus MCS, SAE_J3400 |
locations::ParkingRestriction | 5 values | OpenEnum, plus EMPLOYEES, TAXIS, TENANTS |
tokens::TokenType | closed enum | OpenEnum, plus EMAID |
| payments | absent | new 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:
PriceandRole. - versions
- The Versions module of OCPI 2.2.1.
Constants§
- VERSION
- The version number this module implements.