struct ProcessParameterRaw {
process_id: String,
regions: String,
year: String,
capital_cost: f64,
fixed_operating_cost: f64,
variable_operating_cost: f64,
lifetime: u32,
discount_rate: Option<f64>,
capacity_to_activity: Option<f64>,
}
Fields§
§process_id: String
§regions: String
§year: String
§capital_cost: f64
§fixed_operating_cost: f64
§variable_operating_cost: f64
§lifetime: u32
§discount_rate: Option<f64>
§capacity_to_activity: Option<f64>
Implementations§
Source§impl ProcessParameterRaw
impl ProcessParameterRaw
fn into_parameter(self) -> Result<ProcessParameter>
Source§impl ProcessParameterRaw
impl ProcessParameterRaw
Sourcefn validate(&self) -> Result<()>
fn validate(&self) -> Result<()>
Validates the ProcessParameterRaw
instance.
§Errors
Returns an error if:
lifetime
is 0.discount_rate
is present and less than 0.0.capacity_to_activity
is present and less than 0.0.
§Warnings
Logs a warning if:
discount_rate
is present and greater than 1.0.
§Returns
Returns Ok(())
if all validations pass.
Trait Implementations§
Source§impl Debug for ProcessParameterRaw
impl Debug for ProcessParameterRaw
Source§impl<'de> Deserialize<'de> for ProcessParameterRaw
impl<'de> Deserialize<'de> for ProcessParameterRaw
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 ProcessParameterRaw
impl PartialEq for ProcessParameterRaw
impl StructuralPartialEq for ProcessParameterRaw
Auto Trait Implementations§
impl Freeze for ProcessParameterRaw
impl RefUnwindSafe for ProcessParameterRaw
impl Send for ProcessParameterRaw
impl Sync for ProcessParameterRaw
impl Unpin for ProcessParameterRaw
impl UnwindSafe for ProcessParameterRaw
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> 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