Module cdr

Module cdr 

Source
Expand description

Parse a CDR and price the result with a tariff.

Structs§

ParseReport
A report of calling parse_with_version.
Unversioned
A json::Element that has been parsed by the either the parse_with_version or parse functions and was determined to not be one of the supported Versions.
Versioned
A json::Element that has been parsed by the either the parse_with_version or parse functions and was determined to be one of the supported Versions.

Functions§

parse
Parse the JSON and try guess the Version based on fields defined in the OCPI v2.1.1[^spec-v211] and v2.2.1[^spec-v221] CDR spec.
parse_and_report
Guess the Version of the given CDR JSON and report on any unexpected fields.
parse_with_version
Parse a &str into a Versioned CDR using a schema for the given Version to check for any unexpected fields.
price
Price a single CDR and return a Report.