pub enum LocalDateTime<Tz: TimeZone> {
    Single(DateTime<Tz>),
    Ambiguous(DateTime<Tz>, DateTime<Tz>),
}
Expand description

The conversion time returned by NaiveDateTime::and_local_timezone

Variants§

§

Single(DateTime<Tz>)

§

Ambiguous(DateTime<Tz>, DateTime<Tz>)

Implementations§

source§

impl<Tz: TimeZone> LocalDateTime<Tz>

source

pub fn single(self) -> Option<DateTime<Tz>>

Returns Some when the conversion time is unique, or None otherwise.

source

pub fn earliest(self) -> DateTime<Tz>

Returns the earliest possible conversion time.

source

pub fn latest(self) -> DateTime<Tz>

Returns the latest possible conversion time.

Trait Implementations§

source§

impl<Tz: TimeZone> Add<Duration> for LocalDateTime<Tz>

§

type Output = LocalDateTime<Tz>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Duration) -> Self::Output

Performs the + operation. Read more
source§

impl<Tz: Debug + TimeZone> Debug for LocalDateTime<Tz>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Tz: PartialEq + TimeZone> PartialEq for LocalDateTime<Tz>

source§

fn eq(&self, other: &LocalDateTime<Tz>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Tz: TimeZone> Sub<Duration> for LocalDateTime<Tz>

§

type Output = LocalDateTime<Tz>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Duration) -> Self::Output

Performs the - operation. Read more
source§

impl<Tz: TimeZone> TryFrom<LocalResult<DateTime<Tz>>> for LocalDateTime<Tz>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(res: LocalResult<DateTime<Tz>>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<Tz: Eq + TimeZone> Eq for LocalDateTime<Tz>

source§

impl<Tz: TimeZone> StructuralEq for LocalDateTime<Tz>

source§

impl<Tz: TimeZone> StructuralPartialEq for LocalDateTime<Tz>

Auto Trait Implementations§

§

impl<Tz> RefUnwindSafe for LocalDateTime<Tz>where <Tz as TimeZone>::Offset: RefUnwindSafe,

§

impl<Tz> Send for LocalDateTime<Tz>where <Tz as TimeZone>::Offset: Send,

§

impl<Tz> Sync for LocalDateTime<Tz>where <Tz as TimeZone>::Offset: Sync,

§

impl<Tz> Unpin for LocalDateTime<Tz>where <Tz as TimeZone>::Offset: Unpin,

§

impl<Tz> UnwindSafe for LocalDateTime<Tz>where <Tz as TimeZone>::Offset: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.