pub enum Unit {
Seconds,
Millis,
Micros,
HundredNanos,
Nanos,
Days,
}Expand description
The tick unit a format counts in.
Variants§
Seconds
Whole seconds.
Millis
Milliseconds (Java/JS).
Micros
Microseconds (Chrome/WebKit, PostgreSQL).
HundredNanos
100-nanosecond intervals (FILETIME, .NET ticks).
Nanos
Nanoseconds (APFS, Unix-ns).
Days
Whole days (OLE Automation / Excel serial — usually fractional).
Implementations§
Source§impl Unit
impl Unit
Sourcepub const fn sub_second_digits(self) -> u32
pub const fn sub_second_digits(self) -> u32
Decimal digits of sub-second resolution this unit can express (seconds/days → 0, millis → 3, micros → 6, 100-nanos → 7, nanos → 9). Drives auto-detect granularity scoring: a whole-second raw value is a poor fit for a finer unit, so it is penalised, never hidden.
Trait Implementations§
impl Copy for Unit
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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