Available on crate feature
v2_3_0 only.Expand description
The OCPI 2.3.0 wire model: the canonical model of this crate.
Every other version in ocpi-kit is described as a delta from this one — crate::v2_2_1
re-exports the types that are byte-identical and defines only what changed, and
crate::convert carries objects between them with an explicit account of what was lost.
§What 2.3.0 added
| Area | Change |
|---|---|
payments | new module: payment terminals and financial advice confirmations |
types::Price | {before_taxes, taxes[]} replaces 2.2.1’s {excl_vat, incl_vat} |
tariffs::TaxIncluded | new required Tariff.tax_included, for North American tax rules |
tariffs::PriceLimit | min_price/max_price gained an after_taxes bound |
locations::Parking | new object, for EU AFIR reporting to National Access Points |
locations::ConnectorType | became an OpenEnum, and gained MCS |
locations::ConnectorCapability | new: ISO 15118-2 / -20 Plug & Charge |
tokens::TokenType | became an OpenEnum, and gained EMAID |
types::Role | HUB removed; a hub is now Credentials.hub_party_id |
credentials::Credentials | gained hub_party_id |
locations::Location | gained help_phone |
§Conventions used throughout
- Every object carries an
extensionsfield: undocumented JSON is preserved, never dropped. - A field the spec marks optional (
?) is anOption; a list (*or+) is aVec, and the+cardinality is checked byValidaterather than by the type system, so a peer’s under-filled object still decodes. - A field named
typeon the wire is spelled out in Rust —token_type,image_type,tariff_type— and carries#[serde(rename = "type")]. - Objects that are more than a handful of fields have a compile-time-checked builder:
Location::builder().country_code("NL")…build().
Spec: https://github.com/ocpi/ocpi, release-2.3.0-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 payments::FinancialAdviceConfirmation;pub use payments::Terminal;pub use bookings::Booking;bookingspub use bookings::BookingLocation;bookingspub use bookings::Calendar;bookingspub use invoice_reconciliation::InvoiceReconciliationRecord;invoice-reconciliationpub use invoice_reconciliation::Reconciliation;invoice-reconciliationpub use invoice_reconciliation::reconcile;invoice-reconciliationpub use sessions::Session;pub use tariffs::Tariff;pub use tokens::Token;pub use types::Price;pub use types::Role;pub use types::TaxAmount;pub use versions::Endpoint;pub use versions::Version;pub use versions::VersionDetails;
Modules§
- bookings
bookings - The Bookings module, from the OCPI 2.3.0
bookingsrelease branch. - cdrs
- The CDRs module of OCPI 2.3.0: sealed records of what a session cost.
- charging_
profiles - The Charging Profiles module of OCPI 2.3.0: smart charging limits over time.
- commands
- The Commands module of OCPI 2.3.0: start, stop, reserve, cancel and unlock.
- credentials
- The Credentials module of OCPI 2.3.0: the registration handshake.
- hub_
client_ info - The Hub Client Info module of OCPI 2.3.0: which parties a hub has connected.
- invoice_
reconciliation invoice-reconciliation - The Invoice Reconciliation module, from the OCPI 2.3.0
paymentsrelease branch. - locations
- The Locations module of OCPI 2.3.0: where the EVSEs are and what they can do.
- payments
- The Payments module, new in OCPI 2.3.0: ad-hoc payment terminals and their transactions.
- sessions
- The Sessions module of OCPI 2.3.0: the live view of a charging session.
- tariffs
- The Tariffs module of OCPI 2.3.0: what charging costs.
- tokens
- The Tokens module of OCPI 2.3.0: which drivers may charge, and real-time authorization.
- types
- The spec-wide types whose shape is specific to OCPI 2.3.0:
Price,TaxAmountandRole. - versions
- The Versions module of OCPI 2.3.0: the starting point of every OCPI connection.
Constants§
- VERSION
- The version number this module implements.