pub struct Time { /* private fields */ }Expand description
Time (base UnitDefinition second, s).
Scalar storage of a quantity (f64 and TimeUnit).
Implementations§
Source§impl Time
impl Time
Sourcepub fn yottasecond(value: f64) -> Self
pub fn yottasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::yottasecond.
Sourcepub fn zettasecond(value: f64) -> Self
pub fn zettasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::zettasecond.
Sourcepub fn exasecond(value: f64) -> Self
pub fn exasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::exasecond.
Sourcepub fn petasecond(value: f64) -> Self
pub fn petasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::petasecond.
Sourcepub fn terasecond(value: f64) -> Self
pub fn terasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::terasecond.
Sourcepub fn gigasecond(value: f64) -> Self
pub fn gigasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::gigasecond.
Sourcepub fn megasecond(value: f64) -> Self
pub fn megasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::megasecond.
Sourcepub fn kilosecond(value: f64) -> Self
pub fn kilosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::kilosecond.
Sourcepub fn hectosecond(value: f64) -> Self
pub fn hectosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::hectosecond.
Sourcepub fn decasecond(value: f64) -> Self
pub fn decasecond(value: f64) -> Self
Create a new Time with units of TimeUnit::decasecond.
Sourcepub fn second(value: f64) -> Self
pub fn second(value: f64) -> Self
Create a new Time with units of TimeUnit::second.
Sourcepub fn decisecond(value: f64) -> Self
pub fn decisecond(value: f64) -> Self
Create a new Time with units of TimeUnit::decisecond.
Sourcepub fn centisecond(value: f64) -> Self
pub fn centisecond(value: f64) -> Self
Create a new Time with units of TimeUnit::centisecond.
Sourcepub fn millisecond(value: f64) -> Self
pub fn millisecond(value: f64) -> Self
Create a new Time with units of TimeUnit::millisecond.
Sourcepub fn microsecond(value: f64) -> Self
pub fn microsecond(value: f64) -> Self
Create a new Time with units of TimeUnit::microsecond.
Sourcepub fn nanosecond(value: f64) -> Self
pub fn nanosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::nanosecond.
Sourcepub fn picosecond(value: f64) -> Self
pub fn picosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::picosecond.
Sourcepub fn femtosecond(value: f64) -> Self
pub fn femtosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::femtosecond.
Sourcepub fn attosecond(value: f64) -> Self
pub fn attosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::attosecond.
Sourcepub fn zeptosecond(value: f64) -> Self
pub fn zeptosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::zeptosecond.
Sourcepub fn yoctosecond(value: f64) -> Self
pub fn yoctosecond(value: f64) -> Self
Create a new Time with units of TimeUnit::yoctosecond.
Sourcepub fn second_sidereal(value: f64) -> Self
pub fn second_sidereal(value: f64) -> Self
Create a new Time with units of TimeUnit::second_sidereal.
Sourcepub fn day(value: f64) -> Self
pub fn day(value: f64) -> Self
Create a new Time with units of TimeUnit::day.
Sourcepub fn day_sidereal(value: f64) -> Self
pub fn day_sidereal(value: f64) -> Self
Create a new Time with units of TimeUnit::day_sidereal.
Sourcepub fn hour(value: f64) -> Self
pub fn hour(value: f64) -> Self
Create a new Time with units of TimeUnit::hour.
Sourcepub fn hour_sidereal(value: f64) -> Self
pub fn hour_sidereal(value: f64) -> Self
Create a new Time with units of TimeUnit::hour_sidereal.
Sourcepub fn minute(value: f64) -> Self
pub fn minute(value: f64) -> Self
Create a new Time with units of TimeUnit::minute.
Sourcepub fn shake(value: f64) -> Self
pub fn shake(value: f64) -> Self
Create a new Time with units of TimeUnit::shake.
Sourcepub fn year(value: f64) -> Self
pub fn year(value: f64) -> Self
Create a new Time with units of TimeUnit::year.
Sourcepub fn year_sidereal(value: f64) -> Self
pub fn year_sidereal(value: f64) -> Self
Create a new Time with units of TimeUnit::year_sidereal.
Sourcepub fn year_tropical(value: f64) -> Self
pub fn year_tropical(value: f64) -> Self
Create a new Time with units of TimeUnit::year_tropical.
Sourcepub fn definition(&self) -> UnitDefinition
pub fn definition(&self) -> UnitDefinition
Retrieve the UnitDefinition associated with this Time.
Sourcepub fn to_yottasecond(&self) -> Self
pub fn to_yottasecond(&self) -> Self
Convert to TimeUnit::yottasecond.
Sourcepub fn to_zettasecond(&self) -> Self
pub fn to_zettasecond(&self) -> Self
Convert to TimeUnit::zettasecond.
Sourcepub fn to_exasecond(&self) -> Self
pub fn to_exasecond(&self) -> Self
Convert to TimeUnit::exasecond.
Sourcepub fn to_petasecond(&self) -> Self
pub fn to_petasecond(&self) -> Self
Convert to TimeUnit::petasecond.
Sourcepub fn to_terasecond(&self) -> Self
pub fn to_terasecond(&self) -> Self
Convert to TimeUnit::terasecond.
Sourcepub fn to_gigasecond(&self) -> Self
pub fn to_gigasecond(&self) -> Self
Convert to TimeUnit::gigasecond.
Sourcepub fn to_megasecond(&self) -> Self
pub fn to_megasecond(&self) -> Self
Convert to TimeUnit::megasecond.
Sourcepub fn to_kilosecond(&self) -> Self
pub fn to_kilosecond(&self) -> Self
Convert to TimeUnit::kilosecond.
Sourcepub fn to_hectosecond(&self) -> Self
pub fn to_hectosecond(&self) -> Self
Convert to TimeUnit::hectosecond.
Sourcepub fn to_decasecond(&self) -> Self
pub fn to_decasecond(&self) -> Self
Convert to TimeUnit::decasecond.
Sourcepub fn to_second(&self) -> Self
pub fn to_second(&self) -> Self
Convert to TimeUnit::second.
Sourcepub fn to_decisecond(&self) -> Self
pub fn to_decisecond(&self) -> Self
Convert to TimeUnit::decisecond.
Sourcepub fn to_centisecond(&self) -> Self
pub fn to_centisecond(&self) -> Self
Convert to TimeUnit::centisecond.
Sourcepub fn to_millisecond(&self) -> Self
pub fn to_millisecond(&self) -> Self
Convert to TimeUnit::millisecond.
Sourcepub fn to_microsecond(&self) -> Self
pub fn to_microsecond(&self) -> Self
Convert to TimeUnit::microsecond.
Sourcepub fn to_nanosecond(&self) -> Self
pub fn to_nanosecond(&self) -> Self
Convert to TimeUnit::nanosecond.
Sourcepub fn to_picosecond(&self) -> Self
pub fn to_picosecond(&self) -> Self
Convert to TimeUnit::picosecond.
Sourcepub fn to_femtosecond(&self) -> Self
pub fn to_femtosecond(&self) -> Self
Convert to TimeUnit::femtosecond.
Sourcepub fn to_attosecond(&self) -> Self
pub fn to_attosecond(&self) -> Self
Convert to TimeUnit::attosecond.
Sourcepub fn to_zeptosecond(&self) -> Self
pub fn to_zeptosecond(&self) -> Self
Convert to TimeUnit::zeptosecond.
Sourcepub fn to_yoctosecond(&self) -> Self
pub fn to_yoctosecond(&self) -> Self
Convert to TimeUnit::yoctosecond.
Sourcepub fn to_second_sidereal(&self) -> Self
pub fn to_second_sidereal(&self) -> Self
Convert to TimeUnit::second_sidereal.
Sourcepub fn to_day(&self) -> Self
pub fn to_day(&self) -> Self
Convert to TimeUnit::day.
Sourcepub fn to_day_sidereal(&self) -> Self
pub fn to_day_sidereal(&self) -> Self
Convert to TimeUnit::day_sidereal.
Sourcepub fn to_hour(&self) -> Self
pub fn to_hour(&self) -> Self
Convert to TimeUnit::hour.
Sourcepub fn to_hour_sidereal(&self) -> Self
pub fn to_hour_sidereal(&self) -> Self
Convert to TimeUnit::hour_sidereal.
Sourcepub fn to_minute(&self) -> Self
pub fn to_minute(&self) -> Self
Convert to TimeUnit::minute.
Sourcepub fn to_shake(&self) -> Self
pub fn to_shake(&self) -> Self
Convert to TimeUnit::shake.
Sourcepub fn to_year(&self) -> Self
pub fn to_year(&self) -> Self
Convert to TimeUnit::year.
Sourcepub fn to_year_sidereal(&self) -> Self
pub fn to_year_sidereal(&self) -> Self
Convert to TimeUnit::year_sidereal.
Sourcepub fn to_year_tropical(&self) -> Self
pub fn to_year_tropical(&self) -> Self
Convert to TimeUnit::year_tropical.
Trait Implementations§
Source§impl AddAssign<Quantity> for Time
impl AddAssign<Quantity> for Time
Source§fn add_assign(&mut self, rhs: Quantity)
fn add_assign(&mut self, rhs: Quantity)
+= operation. Read moreSource§impl AddAssign for Time
impl AddAssign for Time
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl DivAssign<f64> for Time
impl DivAssign<f64> for Time
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
/= operation. Read moreSource§impl FixedQuantity<TimeUnit> for Time
impl FixedQuantity<TimeUnit> for Time
Source§fn convert(&self, unit: TimeUnit) -> Self
fn convert(&self, unit: TimeUnit) -> Self
Source§fn convert_mut(&mut self, unit: TimeUnit)
fn convert_mut(&mut self, unit: TimeUnit)
Source§fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>where
Self: Sized,
fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>where
Self: Sized,
Source§impl From<Time> for UnitDefinition
impl From<Time> for UnitDefinition
Source§impl MulAssign<f64> for Time
impl MulAssign<f64> for Time
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
*= operation. Read moreSource§impl PartialOrd for Time
impl PartialOrd for Time
Source§impl SubAssign<Quantity> for Time
impl SubAssign<Quantity> for Time
Source§fn sub_assign(&mut self, rhs: Quantity)
fn sub_assign(&mut self, rhs: Quantity)
-= operation. Read moreSource§impl SubAssign for Time
impl SubAssign for Time
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read more