#[non_exhaustive]pub enum Interval {
ActualInterval(ActualInterval),
ForecastInterval(ForecastInterval),
CurrentInterval(CurrentInterval),
}
Expand description
Interval enum that can be any of the interval 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.
ActualInterval(ActualInterval)
Actual interval with confirmed historical pricing data
ForecastInterval(ForecastInterval)
Forecast interval with predicted future pricing data
CurrentInterval(CurrentInterval)
Current interval with real-time pricing data
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn is_actual_interval(&self) -> bool
pub fn is_actual_interval(&self) -> bool
Returns true
if the interval is ActualInterval
.
Sourcepub fn is_forecast_interval(&self) -> bool
pub fn is_forecast_interval(&self) -> bool
Returns true
if the interval is ForecastInterval
.
Sourcepub fn is_current_interval(&self) -> bool
pub fn is_current_interval(&self) -> bool
Returns true
if the interval is CurrentInterval
.
Sourcepub fn as_actual_interval(&self) -> Option<&ActualInterval>
pub fn as_actual_interval(&self) -> Option<&ActualInterval>
Return a reference to the ActualInterval
variant if it exists.
Sourcepub fn as_forecast_interval(&self) -> Option<&ForecastInterval>
pub fn as_forecast_interval(&self) -> Option<&ForecastInterval>
Return a reference to the ForecastInterval
variant if it exists.
Sourcepub fn as_current_interval(&self) -> Option<&CurrentInterval>
pub fn as_current_interval(&self) -> Option<&CurrentInterval>
Return a reference to the CurrentInterval
variant if it exists.
Sourcepub fn as_base_interval(&self) -> Option<&BaseInterval>
pub fn as_base_interval(&self) -> Option<&BaseInterval>
Returns the base interval if it exists.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Interval
impl<'de> Deserialize<'de> for Interval
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 Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnwindSafe for Interval
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