Struct sgip_signal::Forecast [−][src]
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 Moer
s predicted by this forecast.
Trait Implementations
impl Clone for Forecast
[src]
impl Debug for Forecast
[src]
impl<'de> Deserialize<'de> for Forecast
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Forecast
impl Send for Forecast
impl Sync for Forecast
impl Unpin for Forecast
impl UnwindSafe for Forecast
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,