#[non_exhaustive]pub enum Time {
Show 14 variants
Century,
Decade,
Year,
Week,
Day,
Hour,
Minute,
Second,
Decisecond,
Centisecond,
Millisecond,
Microsecond,
Nanosecond,
Picosecond,
}Expand description
A unit of time.
The listed abbreviations are the abbreviations used to parse the unit with
FromStr. The main abbreviation comes first, followed by any alternate
abbreviations that can be used.
The conversions are listed in terms of the base unit. The base unit for
Time is Time::Second.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Century
100 years, each of 365.25 days.
-
Abbreviation:
cen -
1 cen = 3.15576e9 s
Decade
10 years, each of 365.25 days.
-
Abbreviation:
dec -
1 dec = 3.15576e8 s
Year
A year of 365.25 days. Decades and centuries are defined in terms of this unit.
-
Abbreviation:
yr -
1 yr = 3.15576e7 s
Week
-
Abbreviation:
wk -
1 wk = 604800.0 s
Day
-
Abbreviation:
day -
1 day = 86400.0 s
Hour
-
Abbreviation:
hr -
1 hr = 3600.0 s
Minute
-
Abbreviation:
min -
1 min = 60.0 s
Second
-
Abbreviation:
s -
1 s = 1.0 s
Decisecond
-
Abbreviation:
ds -
1 ds = 0.1 s
Centisecond
-
Abbreviation:
cs -
1 cs = 0.01 s
Millisecond
-
Abbreviation:
ms -
1 ms = 0.001 s
Microsecond
-
Abbreviation:
µs,us -
1 µs = 1e-6 s
Nanosecond
-
Abbreviation:
ns -
1 ns = 1e-9 s
Picosecond
-
Abbreviation:
ps -
1 ps = 1e-12 s
Implementations§
Trait Implementations§
Source§impl Convert for Time
impl Convert for Time
Source§fn conversion_factor(&self) -> f64
fn conversion_factor(&self) -> f64
&self to Convert::BASE, i.e. the value to multiply
a quantity in this unit by, in order to get a quantity in Convert::BASE. If the self
unit is the same as this unit, then this function should return 1.0. Read moreSource§fn conversion_factor_to(&self, _: impl Into<Unit>) -> Option<f64>
fn conversion_factor_to(&self, _: impl Into<Unit>) -> Option<f64>
Convert::BASE, to a base unit that Convert::BASE
is derived from. Returns None if there is no conversion factor, meaning the two units
are unrelated. Read more