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 message_extra: Option<Vec<MessageContent>>,
pub custom_data: Option<CustomData>,
}Expand description
Contains message details, for a message to be displayed on a Charging Station.
The OCPP 2.1 MessageInfo data type.
Fields§
§id: i32Unique id 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>From what date-time should this message be shown. If omitted: directly.
end_date_time: Option<DateTime>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.
message_extra: Option<Vec<MessageContent>>The messageExtra member.
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_message_extra(self, value: Vec<MessageContent>) -> Self
pub fn with_message_extra(self, value: Vec<MessageContent>) -> Self
Sets the optional messageExtra 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§fn clone(&self) -> MessageInfo
fn clone(&self) -> MessageInfo
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 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.