pub enum TimeDirection {
AfterAbsolute(AbsoluteTime),
BeforeAbsolute(AbsoluteTime),
AfterNamed(NamedRelativeTime),
BeforeNamed(NamedRelativeTime),
BeforeNext(RelativeTimeUnit),
BeforeLast(RelativeTimeUnit),
AfterNext(RelativeTimeUnit),
AfterLast(RelativeTimeUnit),
Ago,
FromNow,
}
Expand description
Enumerates the various types of relative times that can be paired with a Duration.
Variants§
AfterAbsolute(AbsoluteTime)
e.g. after 18/7/2025 at 3:22 PM
BeforeAbsolute(AbsoluteTime)
e.g. before 18/7/2025 at 3:22 PM
AfterNamed(NamedRelativeTime)
e.g. after tomorrow
BeforeNamed(NamedRelativeTime)
e.g. before yesterday
BeforeNext(RelativeTimeUnit)
e.g. before next tuesday
BeforeLast(RelativeTimeUnit)
e.g. before last week
AfterNext(RelativeTimeUnit)
e.g. after next thursday
AfterLast(RelativeTimeUnit)
e.g. after last month
Ago
Ago
FromNow
From now
Trait Implementations§
Source§impl Clone for TimeDirection
impl Clone for TimeDirection
Source§fn clone(&self) -> TimeDirection
fn clone(&self) -> TimeDirection
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 Debug for TimeDirection
impl Debug for TimeDirection
Source§impl Display for TimeDirection
impl Display for TimeDirection
Source§impl FromStr for TimeDirection
impl FromStr for TimeDirection
Source§impl Hash for TimeDirection
impl Hash for TimeDirection
Source§impl Ord for TimeDirection
impl Ord for TimeDirection
Source§fn cmp(&self, other: &TimeDirection) -> Ordering
fn cmp(&self, other: &TimeDirection) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl Parse for TimeDirection
impl Parse for TimeDirection
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for TimeDirection
impl PartialEq for TimeDirection
Source§impl PartialOrd for TimeDirection
impl PartialOrd for TimeDirection
impl Copy for TimeDirection
impl Eq for TimeDirection
impl StructuralPartialEq for TimeDirection
Auto Trait Implementations§
impl Freeze for TimeDirection
impl RefUnwindSafe for TimeDirection
impl Send for TimeDirection
impl Sync for TimeDirection
impl Unpin for TimeDirection
impl UnwindSafe for TimeDirection
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