pub struct MessageInfo {
pub id: i32,
pub priority: MessagePriority,
pub message: MessageContent,
pub display: Option<Component>,
pub state: Option<MessageState>,
pub start_date_time: Option<DateTime>,
pub end_date_time: Option<DateTime>,
pub transaction_id: Option<String>,
pub custom_data: Option<CustomData>,
}Expand description
Message_ Info urn:x-enexis:ecdm:uid:2:233264 Contains message details, for a message to be displayed on a Charging Station.
The OCPP 2.0.1 MessageInfo data type.
Fields§
§id: i32Identified_ Object. MRID. Numeric_ Identifier urn:x-enexis:ecdm:uid:1:569198 Master resource identifier, unique within an exchange context. It is defined within the OCPP context as a positive Integer value (greater or equal to zero).
priority: MessagePriorityThe priority member.
message: MessageContentThe message member.
display: Option<Component>The display member.
state: Option<MessageState>The state member.
start_date_time: Option<DateTime>Message_ Info. Start. Date_ Time urn:x-enexis:ecdm:uid:1:569256 From what date-time should this message be shown. If omitted: directly.
end_date_time: Option<DateTime>Message_ Info. End. Date_ Time urn:x-enexis:ecdm:uid:1:569257 Until what date-time should this message be shown, after this date/time this message SHALL be removed.
transaction_id: Option<String>During which transaction shall this message be shown. Message SHALL be removed by the Charging Station after transaction has ended.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl MessageInfo
impl MessageInfo
Sourcepub fn new(id: i32, priority: MessagePriority, message: MessageContent) -> Self
pub fn new(id: i32, priority: MessagePriority, message: MessageContent) -> Self
Creates a MessageInfo from its required fields.
Sourcepub fn with_display(self, value: Component) -> Self
pub fn with_display(self, value: Component) -> Self
Sets the optional display field.
Sourcepub fn with_state(self, value: MessageState) -> Self
pub fn with_state(self, value: MessageState) -> Self
Sets the optional state field.
Sourcepub fn with_start_date_time(self, value: impl Into<DateTime>) -> Self
pub fn with_start_date_time(self, value: impl Into<DateTime>) -> Self
Sets the optional startDateTime field.
Sourcepub fn with_end_date_time(self, value: impl Into<DateTime>) -> Self
pub fn with_end_date_time(self, value: impl Into<DateTime>) -> Self
Sets the optional endDateTime 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_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 MessageInfo
impl Clone for MessageInfo
Source§impl Debug for MessageInfo
impl Debug for MessageInfo
Source§impl<'de> Deserialize<'de> for MessageInfo
impl<'de> Deserialize<'de> for MessageInfo
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 MessageInfo
impl PartialEq for MessageInfo
Source§impl Serialize for MessageInfo
impl Serialize for MessageInfo
impl StructuralPartialEq for MessageInfo
Source§impl Validate for MessageInfo
impl Validate for MessageInfo
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.