ocpp/v2_1/datatype/total_cost

OCPP 2.1 TotalCost data type (schema TotalCostType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

This contains the cost calculated during a transaction. It is used both for running cost and final cost of the transaction.

FieldTypeReqDescription
charging_timePrice
currencyStringCurrency of the costs in ISO 4217 Code. (max 3 chars)
custom_dataCustomData
energyPrice
fixedPrice
idle_timePrice
reservation_fixedPrice
reservation_timePrice
totalTotalPrice
type_of_costTariffCost

Schema: TotalCostType

pub type TotalCost {
  TotalCost(
    charging_time: option.Option(price.Price),
    currency: String,
    custom_data: option.Option(custom_data.CustomData),
    energy: option.Option(price.Price),
    fixed: option.Option(price.Price),
    idle_time: option.Option(price.Price),
    reservation_fixed: option.Option(price.Price),
    reservation_time: option.Option(price.Price),
    total: total_price.TotalPrice,
    type_of_cost: tariff_cost.TariffCost,
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(TotalCost)

Decode a TotalCost from its OCPP-J JSON object, enforcing schema constraints.

pub fn new(
  currency currency: String,
  total total: total_price.TotalPrice,
  type_of_cost type_of_cost: tariff_cost.TariffCost,
) -> TotalCost

Construct a TotalCost from its required fields, with every optional field set to None.

pub fn to_json(value: TotalCost) -> json.Json

Encode a TotalCost to its OCPP-J JSON object.

Search Document