pub struct FixedVar {
pub priority: i32,
pub setpoint: Decimal,
pub unit: DERUnit,
pub start_time: Option<DateTime>,
pub duration: Option<Decimal>,
pub custom_data: Option<CustomData>,
}Expand description
The OCPP 2.1 FixedVar data type.
Fields§
§priority: i32Priority of setting (0=highest)
setpoint: DecimalThe value specifies a target var output interpreted as a signed percentage (-100 to 100). A negative value refers to charging, whereas a positive one refers to discharging. The value type is determined by the unit field.
unit: DERUnitThe unit member.
start_time: Option<DateTime>Time when this setting becomes active.
duration: Option<Decimal>Duration in seconds that this setting is active.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl FixedVar
impl FixedVar
Sourcepub fn new(priority: i32, setpoint: impl Into<Decimal>, unit: DERUnit) -> Self
pub fn new(priority: i32, setpoint: impl Into<Decimal>, unit: DERUnit) -> Self
Creates a FixedVar from its required fields.
Sourcepub fn with_start_time(self, value: impl Into<DateTime>) -> Self
pub fn with_start_time(self, value: impl Into<DateTime>) -> Self
Sets the optional startTime field.
Sourcepub fn with_duration(self, value: impl Into<Decimal>) -> Self
pub fn with_duration(self, value: impl Into<Decimal>) -> Self
Sets the optional duration 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<'de> Deserialize<'de> for FixedVar
impl<'de> Deserialize<'de> for FixedVar
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
impl StructuralPartialEq for FixedVar
Source§impl Validate for FixedVar
impl Validate for FixedVar
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 FixedVar
impl Freeze for FixedVar
impl RefUnwindSafe for FixedVar
impl Send for FixedVar
impl Sync for FixedVar
impl Unpin for FixedVar
impl UnsafeUnpin for FixedVar
impl UnwindSafe for FixedVar
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