pub enum CalendarUnit {
Second,
Minute,
Hour,
Day,
Week,
Month,
Year,
Millisecond,
Microsecond,
Nanosecond,
}Expand description
Calendar and clock time units for Span/Duration expressions.
Day/Week/Month/Year are variable-length CALENDAR units (they feed a Span);
Hour/Minute/Second/Millisecond/Microsecond/Nanosecond are fixed CLOCK units
(they feed a nanosecond Duration) — see parse_span_literal_from_num’s own split. One
enum drives the whole word-form duration grammar (3 seconds, 1 millisecond, 5 days and 2 hours); the compact suffix spellings (100ms, 50ns) are a separate lexer path.
Variants§
Trait Implementations§
Source§impl Clone for CalendarUnit
impl Clone for CalendarUnit
Source§fn clone(&self) -> CalendarUnit
fn clone(&self) -> CalendarUnit
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 CalendarUnit
impl Debug for CalendarUnit
Source§impl PartialEq for CalendarUnit
impl PartialEq for CalendarUnit
impl Copy for CalendarUnit
impl Eq for CalendarUnit
impl StructuralPartialEq for CalendarUnit
Auto Trait Implementations§
impl Freeze for CalendarUnit
impl RefUnwindSafe for CalendarUnit
impl Send for CalendarUnit
impl Sync for CalendarUnit
impl Unpin for CalendarUnit
impl UnsafeUnpin for CalendarUnit
impl UnwindSafe for CalendarUnit
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.