pub struct VariableAttribute {
pub type: Option<Attribute>,
pub value: Option<String>,
pub mutability: Option<Mutability>,
pub persistent: Option<bool>,
pub constant: Option<bool>,
pub custom_data: Option<CustomData>,
}Expand description
Attribute data of a variable.
The OCPP 2.1 VariableAttribute data type.
Fields§
§type: Option<Attribute>The type member.
value: Option<String>Value of the attribute. May only be omitted when mutability is set to ‘WriteOnly’.
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.
mutability: Option<Mutability>The mutability member.
persistent: Option<bool>If true, value will be persistent across system reboots or power down. Default when omitted is false.
Schema default: false.
constant: Option<bool>If true, value that will never be changed by the Charging Station at runtime. Default when omitted is false.
Schema default: false.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl VariableAttribute
impl VariableAttribute
Sourcepub fn with_value(self, value: impl Into<String>) -> Self
pub fn with_value(self, value: impl Into<String>) -> Self
Sets the optional value field.
Sourcepub fn with_mutability(self, value: Mutability) -> Self
pub fn with_mutability(self, value: Mutability) -> Self
Sets the optional mutability field.
Sourcepub fn with_persistent(self, value: bool) -> Self
pub fn with_persistent(self, value: bool) -> Self
Sets the optional persistent field.
Sourcepub fn with_constant(self, value: bool) -> Self
pub fn with_constant(self, value: bool) -> Self
Sets the optional constant 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 VariableAttribute
impl Clone for VariableAttribute
Source§impl Debug for VariableAttribute
impl Debug for VariableAttribute
Source§impl Default for VariableAttribute
impl Default for VariableAttribute
Source§impl<'de> Deserialize<'de> for VariableAttribute
impl<'de> Deserialize<'de> for VariableAttribute
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 VariableAttribute
impl PartialEq for VariableAttribute
Source§impl Serialize for VariableAttribute
impl Serialize for VariableAttribute
impl StructuralPartialEq for VariableAttribute
Source§impl Validate for VariableAttribute
impl Validate for VariableAttribute
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.