ocpi-kit

Install and features

Add ocpi-kit to a Cargo project and choose the feature set your role needs.

On this page
cargo add ocpi-kit
cargo add ocpi-kit --features client,tariffs   # or whichever your role needs

The default features are v2_3_0, v2_2_1 and transport — enough to decode, validate and envelope OCPI messages without pulling in an HTTP stack.

The feature map

FeaturePulls inWhat it gives you
v2_3_0the OCPI 2.3.0 wire model, 59 objects. The canonical model of this crate
v2_2_1v2_3_0the OCPI 2.2.1 wire model, 53 objects, defined as a delta
v2_1_1v2_3_0the OCPI 2.1.1 wire model, 33 objects, for legacy peers
bookingsv2_3_0the Bookings module of the 2.3.0 bookings release branch
invoice-reconciliationv2_3_0the Invoice Reconciliation module of the payments branch
transportenvelope, status codes, headers, credentials tokens, pagination, routing, PATCH
clienttransport, v2_3_0, convert, reqwest, tokioasync client and the registration handshake
servertransport, v2_3_0, convert, axum, tokiothe router and its module traits
hubclient, serverrouting table, forwarder, aggregation, version bridging
convertv2_2_1, v2_3_0Upgrade/Downgrade with loss accounting, and the JSON-level bridge
tariffstzdb, tz-rsthe pricing engine
testkittransportvalidated samples and in-memory stores
schemaschemarsJsonSchema for every wire type
fullall of the aboveeverything except the CLI
clifull, clapthe ocpi binary

The conformance runner comes with client; it needs no feature of its own.

client, server and hub enable convert for the same reason they enable v2_3_0: they speak the canonical model and translate the peer onto it, so a peer on OCPI 2.2.1 — most of the market — is readable at all. See Versions and conversion.

Feature selection is real dependency isolation: with the default features the crate has no async runtime, no HTTP client and no TLS stack. types alone (--no-default-features) compiles for wasm32, so the same models can power browser tooling.

Version support at a glance

A version number this build does not model is still parsedVersionNumber::Custom("3.0") — so discovery against a future peer never fails outright. Only the wire models are gated.

Two questions that look alike and are not:

  • VersionNumber::is_supported() — does this build have a wire model for that version?
  • convert::wire::bridgeable(&from, &to) — can this build carry a document between two of them? Today that is 2.2.1 ↔ 2.3.0 and nothing else; OCPI 2.1.1 is modelled and deliberately not bridged. See Versions and conversion.

Minimum supported Rust version

1.96, edition 2024. Raising the MSRV is a minor-version change.

Installing the CLI

cargo install ocpi-kit --features cli

Improve this page on GitHub