pub struct Transaction {
pub transaction_id: String,
pub charging_state: Option<ChargingState>,
pub time_spent_charging: Option<i32>,
pub stopped_reason: Option<Reason>,
pub remote_start_id: Option<i32>,
pub operation_mode: Option<OperationMode>,
pub tariff_id: Option<String>,
pub transaction_limit: Option<TransactionLimit>,
pub custom_data: Option<CustomData>,
}Expand description
The OCPP 2.1 Transaction data type.
Fields§
§transaction_id: StringThis contains the Id of the transaction.
charging_state: Option<ChargingState>The chargingState member.
time_spent_charging: Option<i32>Contains the total time that energy flowed from EVSE to EV during the transaction (in seconds). Note that timeSpentCharging is smaller or equal to the duration of the transaction.
stopped_reason: Option<Reason>The stoppedReason member.
remote_start_id: Option<i32>The ID given to remote start request (<<requeststarttransactionrequest, RequestStartTransactionRequest>>. This enables to CSMS to match the started transaction to the given start request.
operation_mode: Option<OperationMode>The operationMode member.
tariff_id: Option<String>(2.1) Id of tariff in use for transaction
transaction_limit: Option<TransactionLimit>The transactionLimit member.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(transaction_id: impl Into<String>) -> Self
pub fn new(transaction_id: impl Into<String>) -> Self
Creates a Transaction from its required fields.
Sourcepub fn with_charging_state(self, value: ChargingState) -> Self
pub fn with_charging_state(self, value: ChargingState) -> Self
Sets the optional chargingState field.
Sourcepub fn with_time_spent_charging(self, value: i32) -> Self
pub fn with_time_spent_charging(self, value: i32) -> Self
Sets the optional timeSpentCharging field.
Sourcepub fn with_stopped_reason(self, value: Reason) -> Self
pub fn with_stopped_reason(self, value: Reason) -> Self
Sets the optional stoppedReason field.
Sourcepub fn with_remote_start_id(self, value: i32) -> Self
pub fn with_remote_start_id(self, value: i32) -> Self
Sets the optional remoteStartId field.
Sourcepub fn with_operation_mode(self, value: OperationMode) -> Self
pub fn with_operation_mode(self, value: OperationMode) -> Self
Sets the optional operationMode field.
Sourcepub fn with_tariff_id(self, value: impl Into<String>) -> Self
pub fn with_tariff_id(self, value: impl Into<String>) -> Self
Sets the optional tariffId field.
Sourcepub fn with_transaction_limit(self, value: TransactionLimit) -> Self
pub fn with_transaction_limit(self, value: TransactionLimit) -> Self
Sets the optional transactionLimit 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 Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 Transaction
impl Debug for Transaction
Source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
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 PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl StructuralPartialEq for Transaction
Source§impl Validate for Transaction
impl Validate for Transaction
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.