pub struct MessageContent {
pub format: MessageFormat,
pub content: String,
pub language: Option<String>,
pub custom_data: Option<CustomData>,
}Expand description
Contains message details, for a message to be displayed on a Charging Station.
The OCPP 2.1 MessageContent data type.
Fields§
§format: MessageFormatThe format member.
content: String(2.1) Required. Message contents. + Maximum length supported by Charging Station is given in OCPPCommCtrlr.FieldLength[“MessageContentType.content”]. Maximum length defaults to 1024.
language: Option<String>Message language identifier. Contains a language code as defined in <<ref-RFC5646,[RFC5646]>>.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl MessageContent
impl MessageContent
Sourcepub fn new(format: MessageFormat, content: impl Into<String>) -> Self
pub fn new(format: MessageFormat, content: impl Into<String>) -> Self
Creates a MessageContent from its required fields.
Sourcepub fn with_language(self, value: impl Into<String>) -> Self
pub fn with_language(self, value: impl Into<String>) -> Self
Sets the optional language 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 MessageContent
impl Clone for MessageContent
Source§impl Debug for MessageContent
impl Debug for MessageContent
Source§impl<'de> Deserialize<'de> for MessageContent
impl<'de> Deserialize<'de> for MessageContent
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 MessageContent
impl PartialEq for MessageContent
Source§impl Serialize for MessageContent
impl Serialize for MessageContent
impl StructuralPartialEq for MessageContent
Source§impl Validate for MessageContent
impl Validate for MessageContent
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 MessageContent
impl Freeze for MessageContent
impl RefUnwindSafe for MessageContent
impl Send for MessageContent
impl Sync for MessageContent
impl Unpin for MessageContent
impl UnsafeUnpin for MessageContent
impl UnwindSafe for MessageContent
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