ocpp/v2_1/datatype/rational_number
OCPP 2.1 RationalNumber data type (schema RationalNumberType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Part of ISO 15118-20 price schedule.
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
exponent | Int | ✓ | The exponent to base 10 (dec) |
value | Int | ✓ | Value which shall be multiplied. |
Schema: RationalNumberType
pub type RationalNumber {
RationalNumber(
custom_data: option.Option(custom_data.CustomData),
exponent: Int,
value: Int,
)
}
Constructors
-
RationalNumber( custom_data: option.Option(custom_data.CustomData), exponent: Int, value: Int, )
Values
pub fn decoder() -> decode.Decoder(RationalNumber)
Decode a RationalNumber from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
exponent exponent: Int,
value value: Int,
) -> RationalNumber
Construct a RationalNumber from its required fields, with every optional field set to None.
pub fn to_json(value: RationalNumber) -> json.Json
Encode a RationalNumber to its OCPP-J JSON object.