pub enum Parameter {
Core(CoreParameter),
Custom(CustomParameter),
}
Variants§
Core(CoreParameter)
Custom(CustomParameter)
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Return the parameter’s name if it has one.
Not all parameters are required to have a name in Pywr. Inline parameters may be defined without a name.
Sourcepub fn node_references(&self) -> HashMap<&str, &str>
pub fn node_references(&self) -> HashMap<&str, &str>
Return a map of attribute to node references.
Sourcepub fn parameters(&self) -> HashMap<&str, ParameterValueType<'_>>
pub fn parameters(&self) -> HashMap<&str, ParameterValueType<'_>>
Return a map of attribute to parameter values.
Sourcepub fn resource_paths(&self) -> Vec<PathBuf>
pub fn resource_paths(&self) -> Vec<PathBuf>
Return any external resource paths referenced by this parameter
Sourcepub fn update_resource_paths(&mut self, new_paths: &HashMap<PathBuf, PathBuf>)
pub fn update_resource_paths(&mut self, new_paths: &HashMap<PathBuf, PathBuf>)
Update any external resource paths referenced by this parameter if they are in the provided map.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Parameter
impl<'de> Deserialize<'de> for Parameter
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
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnwindSafe for Parameter
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