pub struct Payload<'a> { /* private fields */ }Expand description
The payload section, typed, with carry-forward resolved.
The raw JSON is kept alongside: it is the source of truth for reproduction, and the only place vendor extensions live.
Implementations§
Source§impl<'a> Payload<'a>
impl<'a> Payload<'a>
Sourcepub const KNOWN_KEYS: [&'static str; 20]
pub const KNOWN_KEYS: [&'static str; 20]
Keys [OCMF Tab. 1–7] defines at the top level.
Sourcepub fn format_version(&self) -> Option<&str>
pub fn format_version(&self) -> Option<&str>
FV — the format version, <major>.<minor>.
Sourcepub fn gateway_id(&self) -> Option<&str>
pub fn gateway_id(&self) -> Option<&str>
GI — identification of the signing component.
Sourcepub fn gateway_serial(&self) -> Option<&str>
pub fn gateway_serial(&self) -> Option<&str>
GS — serial number of the signing component.
Sourcepub fn gateway_version(&self) -> Option<&str>
pub fn gateway_version(&self) -> Option<&str>
GV — software version of the signing component.
Sourcepub fn meter_vendor(&self) -> Option<&str>
pub fn meter_vendor(&self) -> Option<&str>
MV — meter manufacturer.
Sourcepub fn meter_model(&self) -> Option<&str>
pub fn meter_model(&self) -> Option<&str>
MM — meter model.
Sourcepub fn meter_serial(&self) -> Option<&str>
pub fn meter_serial(&self) -> Option<&str>
MS — meter serial number. Marked 1..1 by [OCMF Tab. 3] and
absent from 89 % of real records.
Sourcepub fn meter_firmware(&self) -> Option<&str>
pub fn meter_firmware(&self) -> Option<&str>
MF — meter firmware version.
Sourcepub fn identification_data(&self) -> Option<&str>
pub fn identification_data(&self) -> Option<&str>
ID — the identification data, formatted per IT.
Sourcepub fn tariff_text(&self) -> Option<&str>
pub fn tariff_text(&self) -> Option<&str>
TT — the tariff text, up to 250 characters of free text.
Sourcepub fn charge_controller_firmware(&self) -> Option<&str>
pub fn charge_controller_firmware(&self) -> Option<&str>
CF — charge-controller firmware version (OCMF 1.3+).
Sourcepub fn charge_point_id(&self) -> Option<&str>
pub fn charge_point_id(&self) -> Option<&str>
CI — the charge point’s identifier.
Sourcepub const fn pagination(&self) -> Option<Pagination>
pub const fn pagination(&self) -> Option<Pagination>
PG — pagination.
None when the record wrote no PG, or wrote one that is not a context
letter followed by digits. Both are reported; neither is a reason to
refuse a record whose signature is still checkable.
Sourcepub const fn identification_status(&self) -> Option<bool>
pub const fn identification_status(&self) -> Option<bool>
IS — whether a user was successfully assigned.
Sourcepub const fn identification_level(&self) -> Option<IdentificationLevel<'a>>
pub const fn identification_level(&self) -> Option<IdentificationLevel<'a>>
IL — the overall status of the user assignment.
Sourcepub fn identification_flags(&self) -> Option<&[IdentificationFlag<'a>]>
pub fn identification_flags(&self) -> Option<&[IdentificationFlag<'a>]>
IF — detail flags of the user assignment.
Sourcepub const fn identification_type(&self) -> Option<IdentificationType<'a>>
pub const fn identification_type(&self) -> Option<IdentificationType<'a>>
IT — the type of the identification data.
Sourcepub const fn loss_compensation(&self) -> Option<&LossCompensation<'a>>
pub const fn loss_compensation(&self) -> Option<&LossCompensation<'a>>
LC — cable-loss compensation parameters.
Sourcepub const fn charge_point_id_type(&self) -> Option<ChargePointIdType<'a>>
pub const fn charge_point_id_type(&self) -> Option<ChargePointIdType<'a>>
CT — how the charge point is identified.
Sourcepub const fn object(&self) -> &Object<'a>
pub const fn object(&self) -> &Object<'a>
The payload’s raw JSON — with one hole.
RD is moved into Self::readings while parsing rather than copied,
so its member here is a null placeholder holding the array’s original
span. Everything else is exactly as it was written. This exists to reach
vendor extensions at the top level; each reading’s own JSON is on
Reading::object.
Reproduction never goes through here: that is
Record::payload_text, which is a slice
of the input.
Sourcepub fn marks_transaction_begin(&self) -> bool
pub fn marks_transaction_begin(&self) -> bool
Whether any reading marks the beginning of a transaction
(TX = B) [OCMF Tab. 7].
Both transports need this and neither can share the other’s answer: the
OCA application note puts a record holding both markers under
Transaction.End, while the S.A.F.E. transparency container treats it
as a complete value with no transaction at all. So the question is
answered here and the two conventions are applied where they belong.
Sourcepub fn marks_transaction_end(&self) -> bool
pub fn marks_transaction_end(&self) -> bool
Whether any reading marks the end of a transaction, in any of the
five spellings [OCMF Tab. 7].
Sourcepub fn is_transaction(&self) -> bool
pub fn is_transaction(&self) -> bool
Whether this record refers to a transaction at all.
Fiscal records — readings taken outside any transaction — have no TX
and no user assignment [OCMF Tab. 7].
Sourcepub fn by_register<'r>(&'r self) -> Vec<RegisterSeries<'r, 'a>>
pub fn by_register<'r>(&'r self) -> Vec<RegisterSeries<'r, 'a>>
The readings grouped by register, in first-seen order.
Grouping happens after carry-forward, which is the whole point: LEM meters interleave an import and an export register in one record, and a naive first/last pairing matches an import begin with an export end.