pub struct EventData {Show 15 fields
pub event_id: i32,
pub timestamp: DateTime,
pub trigger: EventTrigger,
pub actual_value: String,
pub component: Component,
pub event_notification_type: EventNotification,
pub variable: Variable,
pub cause: Option<i32>,
pub tech_code: Option<String>,
pub tech_info: Option<String>,
pub cleared: Option<bool>,
pub transaction_id: Option<String>,
pub variable_monitoring_id: Option<i32>,
pub severity: Option<i32>,
pub custom_data: Option<CustomData>,
}Expand description
Class to report an event notification for a component-variable.
The OCPP 2.1 EventData data type.
Fields§
§event_id: i32Identifies the event. This field can be referred to as a cause by other events.
timestamp: DateTimeTimestamp of the moment the report was generated.
trigger: EventTriggerThe trigger member.
actual_value: StringActual value (attributeType Actual) of the variable.
The Configuration Variable <<configkey-reporting-value-size,ReportingValueSize>> can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal.
component: ComponentThe component member.
event_notification_type: EventNotificationThe eventNotificationType member.
variable: VariableThe variable member.
cause: Option<i32>Refers to the Id of an event that is considered to be the cause for this event.
tech_code: Option<String>Technical (error) code as reported by component.
tech_info: Option<String>Technical detail information as reported by component.
cleared: Option<bool>Cleared is set to true to report the clearing of a monitored situation, i.e. a ‘return to normal’.
transaction_id: Option<String>If an event notification is linked to a specific transaction, this field can be used to specify its transactionId.
variable_monitoring_id: Option<i32>Identifies the VariableMonitoring which triggered the event.
severity: Option<i32>(2.1) Severity associated with the monitor in variableMonitoringId or with the hardwired notification.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl EventData
impl EventData
Sourcepub fn new(
event_id: i32,
timestamp: impl Into<DateTime>,
trigger: EventTrigger,
actual_value: impl Into<String>,
component: Component,
event_notification_type: EventNotification,
variable: Variable,
) -> Self
pub fn new( event_id: i32, timestamp: impl Into<DateTime>, trigger: EventTrigger, actual_value: impl Into<String>, component: Component, event_notification_type: EventNotification, variable: Variable, ) -> Self
Creates a EventData from its required fields.
Sourcepub fn with_cause(self, value: i32) -> Self
pub fn with_cause(self, value: i32) -> Self
Sets the optional cause field.
Sourcepub fn with_tech_code(self, value: impl Into<String>) -> Self
pub fn with_tech_code(self, value: impl Into<String>) -> Self
Sets the optional techCode field.
Sourcepub fn with_tech_info(self, value: impl Into<String>) -> Self
pub fn with_tech_info(self, value: impl Into<String>) -> Self
Sets the optional techInfo field.
Sourcepub fn with_cleared(self, value: bool) -> Self
pub fn with_cleared(self, value: bool) -> Self
Sets the optional cleared field.
Sourcepub fn with_transaction_id(self, value: impl Into<String>) -> Self
pub fn with_transaction_id(self, value: impl Into<String>) -> Self
Sets the optional transactionId field.
Sourcepub fn with_variable_monitoring_id(self, value: i32) -> Self
pub fn with_variable_monitoring_id(self, value: i32) -> Self
Sets the optional variableMonitoringId field.
Sourcepub fn with_severity(self, value: i32) -> Self
pub fn with_severity(self, value: i32) -> Self
Sets the optional severity 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<'de> Deserialize<'de> for EventData
impl<'de> Deserialize<'de> for EventData
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>,
impl StructuralPartialEq for EventData
Source§impl Validate for EventData
impl Validate for EventData
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.