Enum datetime::zone::LocalTimes
[−]
[src]
pub enum LocalTimes<'a> {
Impossible,
Precise(ZonedDateTime<'a>),
Ambiguous {
earlier: ZonedDateTime<'a>,
later: ZonedDateTime<'a>,
},
}The result of converting a local time to a zoned time with the same
time components. See TimeZone::convert_local for more information.
Variants
ImpossibleThis local time is impossible (when a time occurs between two timespans, which should never be shown on a wall clock).
Precise(ZonedDateTime<'a>)This local time can be defined unambiguously.
AmbiguousThis local time is ambiguous (when a time overlaps two timespans, which happens twice on a wall clock rather than once).
Fields
earlier: ZonedDateTime<'a> | |
later: ZonedDateTime<'a> |
Methods
impl<'a> LocalTimes<'a>[src]
fn unwrap_precise(self) -> ZonedDateTime<'a>
Extracts the precise zoned date time, if present; panics otherwise.
It is almost always preferable to use pattern matching on a
LocalTimes value and handle the impossible/ambiguous cases
explicitly, rather than risking a panic.
fn is_impossible(&self) -> bool
Returns whether this local times result is impossible (when a time occurs between two timespans, which should never be shown on a wall clock).
fn is_ambiguous(&self) -> bool
Returns whether this local times result is ambiguous (when a time overlaps two timespans, which happens twice on a wall clock rather than once).