pub struct SignedMeterValue {
pub signed_meter_data: String,
pub encoding_method: String,
pub signing_method: Option<String>,
pub public_key: Option<String>,
pub custom_data: Option<CustomData>,
}Expand description
Represent a signed version of the meter value.
The OCPP 2.1 SignedMeterValue data type.
Fields§
§signed_meter_data: StringBase64 encoded, contains the signed data from the meter in the format specified in encodingMethod, which might contain more then just the meter value. It can contain information like timestamps, reference to a customer etc.
encoding_method: StringFormat used by the energy meter to encode the meter data. For example: OCMF or EDL.
signing_method: Option<String>(2.1) Method used to create the digital signature. Optional, if already included in signedMeterData. Standard values for this are defined in Appendix as SigningMethodEnumStringType.
public_key: Option<String>(2.1) Base64 encoded, sending depends on configuration variable PublicKeyWithSignedMeterValue.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl SignedMeterValue
impl SignedMeterValue
Sourcepub fn new(
signed_meter_data: impl Into<String>,
encoding_method: impl Into<String>,
) -> Self
pub fn new( signed_meter_data: impl Into<String>, encoding_method: impl Into<String>, ) -> Self
Creates a SignedMeterValue from its required fields.
Sourcepub fn with_signing_method(self, value: impl Into<String>) -> Self
pub fn with_signing_method(self, value: impl Into<String>) -> Self
Sets the optional signingMethod field.
Sourcepub fn with_public_key(self, value: impl Into<String>) -> Self
pub fn with_public_key(self, value: impl Into<String>) -> Self
Sets the optional publicKey field.
Sourcepub fn with_custom_data(self, value: CustomData) -> Self
pub fn with_custom_data(self, value: CustomData) -> Self
Sets the optional customData field.
Trait Implementations§
Source§impl Clone for SignedMeterValue
impl Clone for SignedMeterValue
Source§impl Debug for SignedMeterValue
impl Debug for SignedMeterValue
Source§impl<'de> Deserialize<'de> for SignedMeterValue
impl<'de> Deserialize<'de> for SignedMeterValue
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 From<&SignedMeterValue> for SignedMeterValue
impl From<&SignedMeterValue> for SignedMeterValue
Source§fn from(value: &SignedMeterValue) -> Self
fn from(value: &SignedMeterValue) -> Self
Source§impl PartialEq for SignedMeterValue
impl PartialEq for SignedMeterValue
Source§impl Serialize for SignedMeterValue
impl Serialize for SignedMeterValue
impl StructuralPartialEq for SignedMeterValue
Source§impl TryFrom<&SignedMeterValue> for SignedMeterValue
Available on crate feature v2_1 only.
impl TryFrom<&SignedMeterValue> for SignedMeterValue
v2_1 only.Source§fn try_from(value: &SignedMeterValue) -> Result<Self, MissingField>
fn try_from(value: &SignedMeterValue) -> Result<Self, MissingField>
2.1 requires only the record and the method it is encoded in; the signing method and the public key became optional, because both can already be inside the record and the key is better obtained out of band.
Source§type Error = MissingField
type Error = MissingField
Source§impl Validate for SignedMeterValue
impl Validate for SignedMeterValue
Source§fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
out, relative to path.