Enum timelang::TimeDirection
source · 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§fn eq(&self, other: &TimeDirection) -> bool
fn eq(&self, other: &TimeDirection) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TimeDirection
impl PartialOrd for TimeDirection
source§fn partial_cmp(&self, other: &TimeDirection) -> Option<Ordering>
fn partial_cmp(&self, other: &TimeDirection) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for TimeDirection
impl Eq for TimeDirection
impl StructuralEq for TimeDirection
impl StructuralPartialEq for TimeDirection
Auto Trait Implementations§
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