pub enum StateVariableConfig {
Distance {
initial: Length,
accumulator: bool,
output_unit: Option<DistanceUnit>,
},
Time {
initial: Time,
accumulator: bool,
output_unit: Option<TimeUnit>,
},
Speed {
initial: Velocity,
accumulator: bool,
output_unit: Option<SpeedUnit>,
},
Energy {
initial: Energy,
accumulator: bool,
output_unit: Option<EnergyUnit>,
},
Ratio {
initial: Ratio,
accumulator: bool,
output_unit: Option<RatioUnit>,
},
Temperature {
initial: ThermodynamicTemperature,
accumulator: bool,
output_unit: Option<TemperatureUnit>,
},
Custom {
custom_type: String,
value: CustomVariableConfig,
accumulator: bool,
},
}Variants§
Implementations§
Source§impl StateVariableConfig
impl StateVariableConfig
pub fn initial_value(&self) -> Result<StateVariable, StateModelError>
pub fn is_accumulator(&self) -> bool
pub fn get_custom_feature_format( &self, ) -> Result<&CustomVariableConfig, StateModelError>
Sourcepub fn get_unit_name(&self) -> Option<String>
pub fn get_unit_name(&self) -> Option<String>
the stringified name of the variable’s output unit, if set by user. if None, it implies the output unit is the Default implementation of the Unit type.
pub fn get_unit_name_or_default(&self) -> String
pub fn get_feature_type(&self) -> String
pub fn serialize_variable( &self, state_variable: &StateVariable, ) -> Result<Value, StateModelError>
Trait Implementations§
Source§impl Clone for StateVariableConfig
impl Clone for StateVariableConfig
Source§fn clone(&self) -> StateVariableConfig
fn clone(&self) -> StateVariableConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StateVariableConfig
impl Debug for StateVariableConfig
Source§impl<'de> Deserialize<'de> for StateVariableConfig
impl<'de> Deserialize<'de> for StateVariableConfig
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 Display for StateVariableConfig
impl Display for StateVariableConfig
Source§impl PartialEq for StateVariableConfig
impl PartialEq for StateVariableConfig
Source§impl PartialOrd for StateVariableConfig
impl PartialOrd for StateVariableConfig
Source§impl Serialize for StateVariableConfig
impl Serialize for StateVariableConfig
impl StructuralPartialEq for StateVariableConfig
Auto Trait Implementations§
impl Freeze for StateVariableConfig
impl RefUnwindSafe for StateVariableConfig
impl Send for StateVariableConfig
impl Sync for StateVariableConfig
impl Unpin for StateVariableConfig
impl UnsafeUnpin for StateVariableConfig
impl UnwindSafe for StateVariableConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more