ocpi_tariffs/explain.rs
1//! Explain an OCPI object in human language.
2//!
3//! Where [`lint`](crate::lint) flags problems in a tariff, `explain` describes what a tariff
4//! actually does: what it charges, for which dimension, and how the rate changes as a session
5//! progresses. The explanation folds in how `ocpi-tariffs` interprets the spec, not just the raw
6//! field values.
7//!
8//! Use [`tariff::explain`](crate::tariff::explain) to explain a tariff.
9
10#[cfg(test)]
11mod test;
12
13#[cfg(test)]
14mod test_real_world;
15
16pub mod tariff;
17
18use crate::{tariff::Warning, Verdict};
19
20/// Explain the given tariff and return the explanation as Markdown.
21pub(crate) fn tariff(tariff: &crate::tariff::Versioned<'_>) -> Verdict<String, Warning> {
22 tariff::explain(tariff)
23}