Enum time_tz::OffsetResult
source · pub enum OffsetResult<T> {
Some(T),
Ambiguous(T, T),
None,
}
Expand description
This represents the possible types of errors when trying to find a local offset.
Variants§
Some(T)
The date time is not ambiguous (exactly 1 is possible).
Ambiguous(T, T)
The date time is ambiguous (2 are possible).
None
The date time is invalid.
Implementations§
source§impl<T> OffsetResult<T>
impl<T> OffsetResult<T>
sourcepub fn unwrap_first(self) -> T
pub fn unwrap_first(self) -> T
Unwraps this OffsetResult resolving ambiguity by taking the first result.
sourcepub fn unwrap_second(self) -> T
pub fn unwrap_second(self) -> T
Unwraps this OffsetResult resolving ambiguity by taking the second result.
sourcepub fn take(self) -> Option<T>
pub fn take(self) -> Option<T>
Turns this OffsetResult into an Option assuming ambiguity is an error.
sourcepub fn take_first(self) -> Option<T>
pub fn take_first(self) -> Option<T>
Turns this OffsetResult into an Option resolving ambiguity by taking the first result.
sourcepub fn take_second(self) -> Option<T>
pub fn take_second(self) -> Option<T>
Turns this OffsetResult into an Option resolving ambiguity by taking the second result.
sourcepub fn is_ambiguous(&self) -> bool
pub fn is_ambiguous(&self) -> bool
Returns true if this OffsetResult is ambiguous.
Trait Implementations§
source§impl<T: Clone> Clone for OffsetResult<T>
impl<T: Clone> Clone for OffsetResult<T>
source§fn clone(&self) -> OffsetResult<T>
fn clone(&self) -> OffsetResult<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for OffsetResult<T>
impl<T: Debug> Debug for OffsetResult<T>
impl<T: Copy> Copy for OffsetResult<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for OffsetResult<T>where T: RefUnwindSafe,
impl<T> Send for OffsetResult<T>where T: Send,
impl<T> Sync for OffsetResult<T>where T: Sync,
impl<T> Unpin for OffsetResult<T>where T: Unpin,
impl<T> UnwindSafe for OffsetResult<T>where T: UnwindSafe,
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