codetics-ocpp201 0.1.0

Codetics OCPP: OCPP 2.0.1 message types with validation and typed dispatch
Documentation
  • Coverage
  • 29.25%
    506 out of 1730 items documented0 out of 377 items with examples
  • Size
  • Source code size: 494.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 16.6 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kevinvavelin

codetics-ocpp201

Every OCPP 2.0.1 (Edition 4) message as plain Rust types. Type names are the specification datatype names without their Type suffix (ChargingProfileType → ChargingProfile).

  • serde mappings matching the message definitions; customData extensions are preserved;
  • Validate implementations for length, range and cardinality constraints, with violations mapped to OCPP-J error codes;
  • Action with message direction, and typed dispatch: StationCall (Charging Station → CSMS) and CsmsCall (CSMS → Charging Station).
use codetics_ocpp201::StationCall;

let p = r#"{"reason":"PowerUp","chargingStation":{"model":"SingleSocketCharger","vendorName":"VendorX"}}"#;
let StationCall::BootNotification(boot) = StationCall::decode("BootNotification", p).unwrap() else { unreachable!() };
assert_eq!(boot.charging_station.vendor_name, "VendorX");

Part of Codetics OCPP

This crate belongs to Codetics OCPP, a complete OCPP 1.6J / 2.0.1 / 2.1 implementation in Rust written by Kevin Vavelin (Codetics). It can be used as is; contributions are welcome.

License and credit

Licensed under the Apache License, Version 2.0.

Copyright 2026 Kevin Vavelin, Codetics. Any redistribution of this crate or of a work derived from it (including forks and products embedding it) must keep the copyright notice and include the NOTICE file crediting Kevin Vavelin / Codetics as the origin of the work.