pub struct SignedData {
pub encoding_method: CiString<36>,
pub encoding_method_version: Option<i32>,
pub public_key: Option<OcpiString<512>>,
pub signed_values: Vec<SignedValue>,
pub url: Option<OcpiString<512>>,
pub extensions: Extensions,
}v2_3_0 only.Expand description
Signed metering data, for German Eichrecht and comparable regimes.
Spec: 2.3.0 §mod_cdrs_signed_data_class
Fields§
§encoding_method: CiString<36>The name of the encoding used, as given by a company or group of companies.
Known implementations include OCMF, Alfen Eichrecht, EDL40 E-Mobility Extension and
EDL40 Mennekes.
encoding_method_version: Option<i32>Version of the encoding method, when applicable.
public_key: Option<OcpiString<512>>Public key used to sign the data, base64 encoded.
signed_values: Vec<SignedValue>One or more signed values. Cardinality +.
url: Option<OcpiString<512>>URL where an EV driver can check the signed data of a charging session.
A string(512), not the URL type every other URL-shaped field in OCPI uses — which is
string(255). Modelling it as a Url would report a conformant
300-character link as TooLong and refuse to construct one, so it is the string the
specification says it is. Url::new_lenient turns it
into one when a caller wants that.
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl SignedData
impl SignedData
Sourcepub fn builder() -> SignedDataBuilder
pub fn builder() -> SignedDataBuilder
Create an instance of SignedData using the builder syntax
Source§impl SignedData
impl SignedData
Sourcepub fn value_for(&self, nature: &str) -> Option<&SignedValue>
pub fn value_for(&self, nature: &str) -> Option<&SignedValue>
The signed value recorded for one nature, compared case-insensitively.
Possible values at moment of writing: Start, End, Intermediate. Others might be added later.
Open by design, so this takes a &str rather than an enum: a peer is free to record a
nature this crate has never heard of, and losing it would defeat the point of the object.
Sourcepub fn start_value(&self) -> Option<&SignedValue>
pub fn start_value(&self) -> Option<&SignedValue>
The Start reading, if the CPO recorded one.
Sourcepub fn end_value(&self) -> Option<&SignedValue>
pub fn end_value(&self) -> Option<&SignedValue>
The End reading, if the CPO recorded one.
Trait Implementations§
Source§impl Clone for SignedData
impl Clone for SignedData
Source§fn clone(&self) -> SignedData
fn clone(&self) -> SignedData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedData
impl Debug for SignedData
Source§impl<'de> Deserialize<'de> for SignedData
impl<'de> Deserialize<'de> for SignedData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SignedData
impl JsonSchema for SignedData
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more