pub struct TotalUsage {
pub energy: Decimal,
pub charging_time: i32,
pub idle_time: i32,
pub reservation_time: Option<i32>,
pub custom_data: Option<CustomData>,
}Expand description
This contains the calculated usage of energy, charging time and idle time during a transaction.
The OCPP 2.1 TotalUsage data type.
Fields§
§energy: DecimalThe energy member.
charging_time: i32Total duration of the charging session (including the duration of charging and not charging), in seconds.
idle_time: i32Total duration of the charging session where the EV was not charging (no energy was transferred between EVSE and EV), in seconds.
reservation_time: Option<i32>Total time of reservation in seconds.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl TotalUsage
impl TotalUsage
Sourcepub fn new(
energy: impl Into<Decimal>,
charging_time: i32,
idle_time: i32,
) -> Self
pub fn new( energy: impl Into<Decimal>, charging_time: i32, idle_time: i32, ) -> Self
Creates a TotalUsage from its required fields.
Sourcepub fn with_reservation_time(self, value: i32) -> Self
pub fn with_reservation_time(self, value: i32) -> Self
Sets the optional reservationTime 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 TotalUsage
impl Clone for TotalUsage
Source§impl Debug for TotalUsage
impl Debug for TotalUsage
Source§impl<'de> Deserialize<'de> for TotalUsage
impl<'de> Deserialize<'de> for TotalUsage
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TotalUsage
impl PartialEq for TotalUsage
Source§impl Serialize for TotalUsage
impl Serialize for TotalUsage
impl StructuralPartialEq for TotalUsage
Source§impl Validate for TotalUsage
impl Validate for TotalUsage
Source§fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
Appends this value’s violations to
out, relative to path.Auto Trait Implementations§
impl Forget for TotalUsage
impl Freeze for TotalUsage
impl Move for TotalUsage
impl RefUnwindSafe for TotalUsage
impl Send for TotalUsage
impl Sync for TotalUsage
impl Unpin for TotalUsage
impl UnsafeUnpin for TotalUsage
impl UnwindSafe for TotalUsage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more