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 custom_data: Option<CustomData>,
}Expand description
Transaction
The OCPP 2.0.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>Transaction. Time_ Spent_ Charging. Elapsed_ Time 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.
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_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§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.