pub enum LooseDateTime {
DateOnly(NaiveDate),
Floating(NaiveDateTime),
Local(DateTime<Local>),
}Expand description
A date and time that may be in different formats, such as date only, floating time, or local time with timezone.
Variants§
DateOnly(NaiveDate)
Date only without time.
Floating(NaiveDateTime)
Floating date and time without timezone.
Local(DateTime<Local>)
Local date and time with timezone. NOTE: This is always in the local timezone of the system running the code.
Implementations§
Source§impl LooseDateTime
impl LooseDateTime
Sourcepub fn with_start_of_day(&self) -> NaiveDateTime
pub fn with_start_of_day(&self) -> NaiveDateTime
Converts to a datetime with default start time (00:00:00) if time is missing.
Sourcepub fn with_end_of_day(&self) -> NaiveDateTime
pub fn with_end_of_day(&self) -> NaiveDateTime
Converts to a datetime with default end time (23:59:59.999999999) if time is missing.
Sourcepub fn position_in_range(
t: &NaiveDateTime,
start: &Option<LooseDateTime>,
end: &Option<LooseDateTime>,
) -> RangePosition
pub fn position_in_range( t: &NaiveDateTime, start: &Option<LooseDateTime>, end: &Option<LooseDateTime>, ) -> RangePosition
Determines the position of a given datetime relative to a start and optional end date.
Trait Implementations§
Source§impl Add<TimeDelta> for LooseDateTime
impl Add<TimeDelta> for LooseDateTime
Source§impl Clone for LooseDateTime
impl Clone for LooseDateTime
Source§fn clone(&self) -> LooseDateTime
fn clone(&self) -> LooseDateTime
Returns a duplicate 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 Debug for LooseDateTime
impl Debug for LooseDateTime
Source§impl From<DatePerhapsTime> for LooseDateTime
impl From<DatePerhapsTime> for LooseDateTime
Source§fn from(dt: DatePerhapsTime) -> Self
fn from(dt: DatePerhapsTime) -> Self
Converts to this type from the input type.
Source§impl From<LooseDateTime> for DatePerhapsTime
impl From<LooseDateTime> for DatePerhapsTime
Source§fn from(dt: LooseDateTime) -> Self
fn from(dt: LooseDateTime) -> Self
Converts to this type from the input type.
Source§impl From<NaiveDate> for LooseDateTime
impl From<NaiveDate> for LooseDateTime
Source§impl From<NaiveDateTime> for LooseDateTime
impl From<NaiveDateTime> for LooseDateTime
Source§fn from(dt: NaiveDateTime) -> Self
fn from(dt: NaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LooseDateTime
impl PartialEq for LooseDateTime
impl Copy for LooseDateTime
impl Eq for LooseDateTime
impl StructuralPartialEq for LooseDateTime
Auto Trait Implementations§
impl Freeze for LooseDateTime
impl RefUnwindSafe for LooseDateTime
impl Send for LooseDateTime
impl Sync for LooseDateTime
impl Unpin for LooseDateTime
impl UnwindSafe for LooseDateTime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more