#[non_exhaustive]pub enum Renewable {
ActualRenewable(ActualRenewable),
ForecastRenewable(ForecastRenewable),
CurrentRenewable(CurrentRenewable),
}
Expand description
Renewable enum that can be any of the renewable types
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ActualRenewable(ActualRenewable)
Actual renewable data with confirmed historical values
ForecastRenewable(ForecastRenewable)
Forecast renewable data with predicted future values
CurrentRenewable(CurrentRenewable)
Current renewable data with real-time values
Implementations§
Source§impl Renewable
impl Renewable
Sourcepub fn is_actual_renewable(&self) -> bool
pub fn is_actual_renewable(&self) -> bool
Returns true
if the renewable is ActualRenewable
.
Sourcepub fn is_forecast_renewable(&self) -> bool
pub fn is_forecast_renewable(&self) -> bool
Returns true
if the renewable is ForecastRenewable
.
Sourcepub fn is_current_renewable(&self) -> bool
pub fn is_current_renewable(&self) -> bool
Returns true
if the renewable is CurrentRenewable
.
Sourcepub fn as_actual_renewable(&self) -> Option<&ActualRenewable>
pub fn as_actual_renewable(&self) -> Option<&ActualRenewable>
Return a reference to the ActualRenewable
variant if it exists.
Sourcepub fn as_forecast_renewable(&self) -> Option<&ForecastRenewable>
pub fn as_forecast_renewable(&self) -> Option<&ForecastRenewable>
Return a reference to the ForecastRenewable
variant if it exists.
Sourcepub fn as_current_renewable(&self) -> Option<&CurrentRenewable>
pub fn as_current_renewable(&self) -> Option<&CurrentRenewable>
Return a reference to the CurrentRenewable
variant if it exists.
Sourcepub fn as_base_renewable(&self) -> &BaseRenewable
pub fn as_base_renewable(&self) -> &BaseRenewable
Returns the base renewable data
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Renewable
impl<'de> Deserialize<'de> for Renewable
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 Renewable
Auto Trait Implementations§
impl Freeze for Renewable
impl RefUnwindSafe for Renewable
impl Send for Renewable
impl Sync for Renewable
impl Unpin for Renewable
impl UnwindSafe for Renewable
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