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

Impossible

This 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.

Ambiguous

This 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).

Trait Implementations

impl<'a> Debug for LocalTimes<'a>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.