pub enum TimeSliceSelection {
Annual,
Season(Season),
Single(TimeSliceID),
}
Expand description
Represents a time slice read from an input file, which can be all
Variants§
Annual
All year and all day
Season(Season)
Only applies to one season
Single(TimeSliceID)
Only applies to a single time slice
Implementations§
Source§impl TimeSliceSelection
impl TimeSliceSelection
Sourcepub fn level(&self) -> TimeSliceLevel
pub fn level(&self) -> TimeSliceLevel
The TimeSliceLevel
to which this TimeSliceSelection
corresponds
Sourcepub fn iter<'a>(
&'a self,
time_slice_info: &'a TimeSliceInfo,
) -> Box<dyn Iterator<Item = (&'a TimeSliceID, Dimensionless)> + 'a>
pub fn iter<'a>( &'a self, time_slice_info: &'a TimeSliceInfo, ) -> Box<dyn Iterator<Item = (&'a TimeSliceID, Dimensionless)> + 'a>
Iterate over the subset of time slices in this selection
Sourcepub fn iter_at_level<'a>(
&'a self,
time_slice_info: &'a TimeSliceInfo,
level: TimeSliceLevel,
) -> Option<Box<dyn Iterator<Item = (Self, Dimensionless)> + 'a>>
pub fn iter_at_level<'a>( &'a self, time_slice_info: &'a TimeSliceInfo, level: TimeSliceLevel, ) -> Option<Box<dyn Iterator<Item = (Self, Dimensionless)> + 'a>>
Iterate over this TimeSliceSelection
at the specified level.
For example, this allows you to iterate over a TimeSliceSelection::Season
at the level
of either seasons (in which case, the iterator will just contain the season) or time slices
(in which case it will contain all time slices for that season).
Note that you cannot iterate over a TimeSliceSelection
with coarser temporal granularity
than the TimeSliceSelection
itself (for example, you cannot iterate over a
TimeSliceSelection::Season
at the TimeSliceLevel::Annual
level). In this case, the
function will return None
.
Trait Implementations§
Source§impl Clone for TimeSliceSelection
impl Clone for TimeSliceSelection
Source§fn clone(&self) -> TimeSliceSelection
fn clone(&self) -> TimeSliceSelection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TimeSliceSelection
impl Debug for TimeSliceSelection
Source§impl Display for TimeSliceSelection
impl Display for TimeSliceSelection
Source§impl From<Season> for TimeSliceSelection
impl From<Season> for TimeSliceSelection
Source§impl From<TimeSliceID> for TimeSliceSelection
impl From<TimeSliceID> for TimeSliceSelection
Source§fn from(value: TimeSliceID) -> Self
fn from(value: TimeSliceID) -> Self
Source§impl Hash for TimeSliceSelection
impl Hash for TimeSliceSelection
Source§impl PartialEq for TimeSliceSelection
impl PartialEq for TimeSliceSelection
impl Eq for TimeSliceSelection
impl StructuralPartialEq for TimeSliceSelection
Auto Trait Implementations§
impl Freeze for TimeSliceSelection
impl RefUnwindSafe for TimeSliceSelection
impl !Send for TimeSliceSelection
impl !Sync for TimeSliceSelection
impl Unpin for TimeSliceSelection
impl UnwindSafe for TimeSliceSelection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more