pub struct VariableCharacteristics {
pub data_type: Data,
pub supports_monitoring: bool,
pub unit: Option<String>,
pub min_limit: Option<Decimal>,
pub max_limit: Option<Decimal>,
pub max_elements: Option<i32>,
pub values_list: Option<String>,
pub custom_data: Option<CustomData>,
}Expand description
Fixed read-only parameters of a variable.
The OCPP 2.1 VariableCharacteristics data type.
Fields§
§data_type: DataThe dataType member.
supports_monitoring: boolFlag indicating if this variable supports monitoring.
unit: Option<String>Unit of the variable. When the transmitted value has a unit, this field SHALL be included.
min_limit: Option<Decimal>Minimum possible value of this variable.
max_limit: Option<Decimal>Maximum possible value of this variable. When the datatype of this Variable is String, OptionList, SequenceList or MemberList, this field defines the maximum length of the (CSV) string.
max_elements: Option<i32>(2.1) Maximum number of elements from valuesList that are supported as attributeValue.
values_list: Option<String>Mandatory when dataType = OptionList, MemberList or SequenceList. In that case valuesList specifies the allowed values for the type.
The length of this field can be limited by DeviceDataCtrlr.ConfigurationValueSize.
-
OptionList: The (Actual) Variable value must be a single value from the reported (CSV) enumeration list.
-
MemberList: The (Actual) Variable value may be an (unordered) (sub-)set of the reported (CSV) valid values list.
-
SequenceList: The (Actual) Variable value may be an ordered (priority, etc) (sub-)set of the reported (CSV) valid values.
This is a comma separated list.
The Configuration Variable <<configkey-configuration-value-size,ConfigurationValueSize>> can be used to limit SetVariableData.attributeValue and VariableCharacteristics.valuesList. The max size of these values will always remain equal.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl VariableCharacteristics
impl VariableCharacteristics
Sourcepub fn new(data_type: Data, supports_monitoring: bool) -> Self
pub fn new(data_type: Data, supports_monitoring: bool) -> Self
Creates a VariableCharacteristics from its required fields.
Sourcepub fn with_min_limit(self, value: impl Into<Decimal>) -> Self
pub fn with_min_limit(self, value: impl Into<Decimal>) -> Self
Sets the optional minLimit field.
Sourcepub fn with_max_limit(self, value: impl Into<Decimal>) -> Self
pub fn with_max_limit(self, value: impl Into<Decimal>) -> Self
Sets the optional maxLimit field.
Sourcepub fn with_max_elements(self, value: i32) -> Self
pub fn with_max_elements(self, value: i32) -> Self
Sets the optional maxElements field.
Sourcepub fn with_values_list(self, value: impl Into<String>) -> Self
pub fn with_values_list(self, value: impl Into<String>) -> Self
Sets the optional valuesList 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 VariableCharacteristics
impl Clone for VariableCharacteristics
Source§impl Debug for VariableCharacteristics
impl Debug for VariableCharacteristics
Source§impl<'de> Deserialize<'de> for VariableCharacteristics
impl<'de> Deserialize<'de> for VariableCharacteristics
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 VariableCharacteristics
impl PartialEq for VariableCharacteristics
Source§impl Serialize for VariableCharacteristics
impl Serialize for VariableCharacteristics
impl StructuralPartialEq for VariableCharacteristics
Source§impl Validate for VariableCharacteristics
impl Validate for VariableCharacteristics
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.