Enum AmbiguousOffset
pub enum AmbiguousOffset
A possibly ambiguous Offset.
One of three possibilities encoded by this type occurs when converting a civil datetime into a specific instant in time. In rare cases, the civil datetime can fall into a gap or a fold, in which case, one of two offsets could be applicable. Or, perhaps, neither. Callers must decide how best to handle these cases.
Variants
-
Unambiguous { offset: Offset } The offset for a particular civil datetime and time zone is unambiguous.
This is the overwhelmingly common case. In general, the only time this case does not occur is when there is a transition to a different time zone (rare) or to/from daylight saving time (occurs for 1 hour twice in year in many geographic locations).
-
Gap { before: Offset, after: Offset } The offset for a particular civil datetime and time zone is ambiguous because there is a gap.
This most commonly occurs when a civil datetime corresponds to an hour that was "skipped" in a jump to DST (daylight saving time).
-
Fold { before: Offset, after: Offset } The offset for a particular civil datetime and time zone is ambiguous because there is a fold.
This most commonly occurs when a civil datetime corresponds to an hour that was "repeated" in a jump to standard time from DST (daylight saving time).
Trait Implementations
impl Clone for AmbiguousOffset
fn clone(&self) -> AmbiguousOffset
impl Copy for AmbiguousOffset
impl Debug for AmbiguousOffset
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for AmbiguousOffset
impl PartialEq for AmbiguousOffset
fn eq(&self, other: &AmbiguousOffset) -> bool
impl StructuralPartialEq for AmbiguousOffset
Auto Trait Implementations
impl Freeze for AmbiguousOffset
impl RefUnwindSafe for AmbiguousOffset
impl Send for AmbiguousOffset
impl Sync for AmbiguousOffset
impl Unpin for AmbiguousOffset
impl UnsafeUnpin for AmbiguousOffset
impl UnwindSafe for AmbiguousOffset
Blanket Implementations
impl<T> Any for AmbiguousOffset
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for AmbiguousOffset
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for AmbiguousOffset
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for AmbiguousOffset
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for AmbiguousOffset
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for AmbiguousOffset
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for AmbiguousOffset
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for AmbiguousOffset
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for AmbiguousOffset
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>