Skip to main content

Module v2_3_0

Module v2_3_0 

Source
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

AreaChange
paymentsnew module: payment terminals and financial advice confirmations
types::Price{before_taxes, taxes[]} replaces 2.2.1’s {excl_vat, incl_vat}
tariffs::TaxIncludednew required Tariff.tax_included, for North American tax rules
tariffs::PriceLimitmin_price/max_price gained an after_taxes bound
locations::Parkingnew object, for EU AFIR reporting to National Access Points
locations::ConnectorTypebecame an OpenEnum, and gained MCS
locations::ConnectorCapabilitynew: ISO 15118-2 / -20 Plug & Charge
tokens::TokenTypebecame an OpenEnum, and gained EMAID
types::RoleHUB removed; a hub is now Credentials.hub_party_id
credentials::Credentialsgained hub_party_id
locations::Locationgained help_phone

§Conventions used throughout

  • Every object carries an extensions field: undocumented JSON is preserved, never dropped.
  • A field the spec marks optional (?) is an Option; a list (* or +) is a Vec, and the + cardinality is checked by Validate rather than by the type system, so a peer’s under-filled object still decodes.
  • A field named type on 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;bookings
pub use bookings::BookingLocation;bookings
pub use bookings::Calendar;bookings
pub use invoice_reconciliation::InvoiceReconciliationRecord;invoice-reconciliation
pub use invoice_reconciliation::Reconciliation;invoice-reconciliation
pub use invoice_reconciliation::reconcile;invoice-reconciliation
pub 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§

bookingsbookings
The Bookings module, from the OCPI 2.3.0 bookings release 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_reconciliationinvoice-reconciliation
The Invoice Reconciliation module, from the OCPI 2.3.0 payments release 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, TaxAmount and Role.
versions
The Versions module of OCPI 2.3.0: the starting point of every OCPI connection.

Constants§

VERSION
The version number this module implements.