Enum temporal_rs::options::TemporalUnit
source · pub enum TemporalUnit {
Auto = 0,
Nanosecond = 1,
Microsecond = 2,
Millisecond = 3,
Second = 4,
Minute = 5,
Hour = 6,
Day = 7,
Week = 8,
Month = 9,
Year = 10,
}
Expand description
The relevant unit that should be used for the operation that this option is provided as a value.
Variants§
Auto = 0
The Auto
unit
Nanosecond = 1
The Nanosecond
unit
Microsecond = 2
The Microsecond
unit
Millisecond = 3
The Millisecond
unit
Second = 4
The Second
unit
Minute = 5
The Minute
unit
Hour = 6
The Hour
unit
Day = 7
The Day
unit
Week = 8
The Week
unit
Month = 9
The Month
unit
Year = 10
The Year
unit
Implementations§
source§impl TemporalUnit
impl TemporalUnit
sourcepub fn to_maximum_rounding_increment(self) -> Option<u16>
pub fn to_maximum_rounding_increment(self) -> Option<u16>
Returns the MaximumRoundingIncrement
for the current TemporalUnit
.
sourcepub fn as_nanoseconds(&self) -> Option<f64>
pub fn as_nanoseconds(&self) -> Option<f64>
Returns the Nanosecond amount for any given value.
pub fn is_calendar_unit(&self) -> bool
Trait Implementations§
source§impl Clone for TemporalUnit
impl Clone for TemporalUnit
source§fn clone(&self) -> TemporalUnit
fn clone(&self) -> TemporalUnit
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 TemporalUnit
impl Debug for TemporalUnit
source§impl Display for TemporalUnit
impl Display for TemporalUnit
source§impl From<usize> for TemporalUnit
impl From<usize> for TemporalUnit
source§impl FromStr for TemporalUnit
impl FromStr for TemporalUnit
source§impl Ord for TemporalUnit
impl Ord for TemporalUnit
source§fn cmp(&self, other: &TemporalUnit) -> Ordering
fn cmp(&self, other: &TemporalUnit) -> 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 PartialEq for TemporalUnit
impl PartialEq for TemporalUnit
source§fn eq(&self, other: &TemporalUnit) -> bool
fn eq(&self, other: &TemporalUnit) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TemporalUnit
impl PartialOrd for TemporalUnit
source§fn partial_cmp(&self, other: &TemporalUnit) -> Option<Ordering>
fn partial_cmp(&self, other: &TemporalUnit) -> 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 TemporalUnit
impl Eq for TemporalUnit
impl StructuralPartialEq for TemporalUnit
Auto Trait Implementations§
impl RefUnwindSafe for TemporalUnit
impl Send for TemporalUnit
impl Sync for TemporalUnit
impl Unpin for TemporalUnit
impl UnwindSafe for TemporalUnit
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