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
sourceimpl<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
sourceimpl<T: Clone> Clone for OffsetResult<T>
impl<T: Clone> Clone for OffsetResult<T>
sourcefn clone(&self) -> OffsetResult<T>
fn clone(&self) -> OffsetResult<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more