Struct sgip_signal::Forecast[][src]

pub struct Forecast {
    pub region: GridRegion,
    pub generated_at: DateTime<Utc>,
    pub data: BTreeMap<DateTime<Utc>, f64>,
}

A forecast of future MOERs.

To get the Moer this forecast predicts at a given time, use Forecast::at.

Fields

region: GridRegion

The grid region for the forecast.

generated_at: DateTime<Utc>

The time when the forecast was generated.

data: BTreeMap<DateTime<Utc>, f64>

The forecast itself, mapping the start time of each interval to the emissions rate, in kg CO2 / kWh.

Implementations

impl Forecast[src]

pub fn at(&self, time: DateTime<Utc>) -> Option<Moer>[src]

Return the forecasted Moer for the given time, or None if the time is not included in the forecast.

Note: because the forecast data returned by the SGIP Signal API does not include explicit end-times, this method treats the start of the next time interval as the end of the previous one, and therefore treats the start of the last time interval as the end of the forecast range.

pub fn moers(&self) -> impl Iterator<Item = Moer> + '_[src]

Iterate over the Moers predicted by this forecast.

Trait Implementations

impl Clone for Forecast[src]

impl Debug for Forecast[src]

impl<'de> Deserialize<'de> for Forecast[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.