pub enum LocalToUtc {
Unique(i64),
Ambiguous {
earlier: i64,
later: i64,
},
Nonexistent,
}Expand description
The result of converting a local date and time to UTC.
Variants§
Unique(i64)
The local time maps to exactly one UTC instant, in seconds since the Unix epoch.
Ambiguous
The local time happens twice, because the clocks were set back. earlier
and later are the two UTC instants in seconds since the Unix epoch;
earlier is the one with the larger offset east of UTC.
Nonexistent
The local time never happens, because the clocks were set forward, or
because no UTC instant in the i64 second range can represent it.
Implementations§
Source§impl LocalToUtc
impl LocalToUtc
Sourcepub fn is_ambiguous(&self) -> bool
pub fn is_ambiguous(&self) -> bool
Whether the local time happens twice.
Sourcepub fn is_nonexistent(&self) -> bool
pub fn is_nonexistent(&self) -> bool
Whether the local time never happens.
Trait Implementations§
Source§impl Clone for LocalToUtc
impl Clone for LocalToUtc
Source§fn clone(&self) -> LocalToUtc
fn clone(&self) -> LocalToUtc
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalToUtc
impl Debug for LocalToUtc
Source§impl PartialEq for LocalToUtc
impl PartialEq for LocalToUtc
Source§fn eq(&self, other: &LocalToUtc) -> bool
fn eq(&self, other: &LocalToUtc) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for LocalToUtc
impl Eq for LocalToUtc
impl StructuralPartialEq for LocalToUtc
Auto Trait Implementations§
impl Freeze for LocalToUtc
impl RefUnwindSafe for LocalToUtc
impl Send for LocalToUtc
impl Sync for LocalToUtc
impl Unpin for LocalToUtc
impl UnsafeUnpin for LocalToUtc
impl UnwindSafe for LocalToUtc
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
Mutably borrows from an owned value. Read more